Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding Existing Form to C++/CLI WinForms Project

I have two C++/CLI projects A and B in separate solutions. I use A for experiments/testing and move the tested code to B once I am finished testing. However, I find that on adding a windows forms class (header, cpp and resx) to project B, I am no longer able to use the visual forms designer of the IDE. How do I enable that?

like image 805
Agnel Kurian Avatar asked Feb 25 '09 06:02

Agnel Kurian


People also ask

How do I add a form to an existing project?

Right-click on the project and choose Add > Form (Windows Forms). In the Name box, type a name for your form, such as MyNewForm. Visual Studio will provide a default and unique name that you may use.

How do I add a form from one project to another in Visual Studio?

Select Visual Studio menu Project -> Add Existing Item... Then select (browse) in the file dialog the Form. cs (Form = name of the form) you want to add to the project and the form (with all associated files) is (copied and) added to your project.

Will WinForms be deprecated?

WinForms is based on the user32/GDI technology that has existed since the dawn of modern Windows. It is not going to go anywhere, in all senses of the phrase: it won't get new features; it won't get support dropped.


1 Answers

Got it!

  1. Open the Solution Explorer pane and the Properties pane side-by-side.
  2. Select the header file for the form class in the Solution Explorer pane.
  3. In the properties pane, select "C++ Form" under the "File Type" property.

The header file will now display a form icon next to it's name and will open in the form editor when double clicked.

like image 78
Agnel Kurian Avatar answered Oct 09 '22 08:10

Agnel Kurian