none
Form Designer falling

    Question

  • I'm using VS Community 2015 and working with Forms in C++. Form Designer falls when I use Button() instead of System::Windows::Forms::Button() in my code. But the project is compiled and run well at the same time.

    There all actions I've done:

     

    1) create C++ CLR empty project

    2) Project -> Add New Item -> UI -> Windows Forms
      (Designer always shows error "The data necessary to complete this operation is not yet avaliable, if I close it and open again it works well. Screenshot: postimg dot org/image/ab6nk9ozx)

    3) edit MyForm.cpp like this:

    #include "MyForm.h"
    
    using namespace System;
    using namespace System::Windows::Forms;
    
    [STAThread]
    void Main(array<String^>^ args)  {
        Application::EnableVisualStyles();
        Application::SetCompatibleTextRenderingDefault(false);
    
        test123::MyForm form;
        Application::Run(%form);
    }
     4) Project -> Properties -> Linker -> System -> SubSystem = Windows

         Project -> Properties -> Linker -> Advanced -> EntryPoint = Main

    5) add Button using Designer

    ===== at the moment all works well ===

    6) as in MyForm.h it exist "using namespace System::Windows::Forms;"
       replace "this->button1 = (gcnew System::Windows::Forms::Button());"
          with "this->button1 = (gcnew Button());"

    7) open Designer

    ===== now it doesn't work and showing error "Could not find type 'Button'" =====

    Screenshot: postimg dot org/image/uqv7j61e7

    At the same time project is compieled and run well, but Designer doesn't work

    If I return back "System::Windows::Forms::" the error disappears and Designer work well


    • Edited by PiN73 Wednesday, February 08, 2017 1:09 PM
    Wednesday, February 08, 2017 12:53 PM

All replies

  • Hi friend,

    If Visual Studio is natively 32bit and one cannot do GUI editing for some components (E.g. ListView) in 64bit.

    You may fix it by the follow steps, when you're facing this issue:

    1.             Change the solution to 32bit
    2.             Clean and rebuild the solution
    3.             Open the GUI for editing
    4.             Save, change the solution back to 64bit
    5.             Clean and rebuild
    6.             Run in 64bit

    Best regards,

    Fletch


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Thursday, February 09, 2017 5:10 AM