How to switch to Form Designer for inserted Form.h?
-
I have designed a Winform Form, lets say Form1.h. I can switch to its Form designer and drop components etc. Now, if i insert this Form1.h in a different solution/project, i can compile, call the Form, but i cannot switch to the form designer. It's like a plain .h file. How can i make VS2008 understand that this is a form, so that i can edit it visually? I'm using VS2008 C++/CLR. Thanks
-
I have designed a Winform Form, lets say Form1.h. I can switch to its Form designer and drop components etc. Now, if i insert this Form1.h in a different solution/project, i can compile, call the Form, but i cannot switch to the form designer. It's like a plain .h file. How can i make VS2008 understand that this is a form, so that i can edit it visually? I'm using VS2008 C++/CLR. Thanks
uus831 wrote:
Now, if i insert this Form1.h in a different solution/project, i can compile, call the Form, but i cannot switch to the form designer.
What if you copy and add the Form1.resx file to the new project as well? Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
uus831 wrote:
Now, if i insert this Form1.h in a different solution/project, i can compile, call the Form, but i cannot switch to the form designer.
What if you copy and add the Form1.resx file to the new project as well? Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
I have designed a Winform Form, lets say Form1.h. I can switch to its Form designer and drop components etc. Now, if i insert this Form1.h in a different solution/project, i can compile, call the Form, but i cannot switch to the form designer. It's like a plain .h file. How can i make VS2008 understand that this is a form, so that i can edit it visually? I'm using VS2008 C++/CLR. Thanks
I ran into a similar problem not long ago (using VS2005 Pro). Here's how I solved it 1. In the project you want a copy of the Form1, simply add a new Form object. Be sure to call it Form1 was well (or whatever you called it in your original project). 2. Delete the .h and .cpp files for the form you just created. Leave the .resx file alone. 3. Copy Form1.h and Form1.cpp from your original project to your new project and compile. Be sure to rename them to whatever you called the form you just deleted. Since your copied form is now the same name, it should work just fine. I'm not certain if this is exactly what I did, but I have it documented at work. I can check on it Monday. Dybs
-
I ran into a similar problem not long ago (using VS2005 Pro). Here's how I solved it 1. In the project you want a copy of the Form1, simply add a new Form object. Be sure to call it Form1 was well (or whatever you called it in your original project). 2. Delete the .h and .cpp files for the form you just created. Leave the .resx file alone. 3. Copy Form1.h and Form1.cpp from your original project to your new project and compile. Be sure to rename them to whatever you called the form you just deleted. Since your copied form is now the same name, it should work just fine. I'm not certain if this is exactly what I did, but I have it documented at work. I can check on it Monday. Dybs
-
Thanks!!! It works! I have tried, and it works great. Except, that you need to rename the namespace so that it is the same in the new project. Great tip! Thanks again.