Click to See Complete Forum and Search --> : View Designer Missing for GUI form


pttsui
June 13th, 2006, 06:24 AM
Hi all. I am now suffering from a problem that I have created a form in Project A. I want to reuse the form in Project B.

When I paste the file to Project B folder and add it to the project, it can be compiled and runs fine. But when I right click in the header file of the form, the "View Designer" choice is missing.

Now I just have no way to edit the form. Any one has similar problem? Or any clue to tackle it?

P.S.I use VC++ .net 2005 CLR project

cilu
June 14th, 2006, 06:28 AM
Adding only the header is not enough. Let's say your form in Project A is called Form1. You should have a Form1.h and a Form1.resx file. And you have to add them both to the second project. But that's not enough. If you open the project file in an editor (notepad.exe) you can see they are referred in this way:

<File
RelativePath=".\Form1.h"
>
</File>
<File
RelativePath=".\Form1.resx"
SubType="Designer"
>
</File>

Now, what you have to do, is put the second file under the first one, and specify the file type for the first:

<File
RelativePath=".\Form1.h"
FileType="3"
>
<File
RelativePath=".\Form1.resx"
SubType="Designer"
>
</File>
</File>

Now, if you open the project again you will have that option.