Microsoft KB Archive/843402

= You cannot view the Windows Forms designer of a Windows Form in Visual C++ .NET or in Visual C++ 2005 =

Article ID: 843402

Article Last Modified on 11/14/2007

-

APPLIES TO


 * Microsoft Visual C++ 2005 Express Edition
 * Microsoft Visual C++ .NET 2003 Standard Edition

-





SYMPTOMS
You add an existing Windows Form in a Microsoft Visual C++ .NET or Microsoft Visual C++ 2005 project. When you try to open the Windows Form, you cannot view the Windows Form designer. You view the Code window of the Windows Form instead of the Windows Form designer.



CAUSE
By default, the FileType property of a Windows Form that is added from an existing Visual C++ .NET or Visual C++ 2005 project is C++ Header File. If the FileType property of the Windows Form is C++ Header File, you cannot view the Windows Form designer.



WORKAROUND
To work around this problem, change the FileType property value of the Windows Form from C++ Header File to C++ Form. To do this, follow these steps:
 * 1) In Solution Explorer, click the Windows Form name that is added from an existing project. For example, in Solution Explorer, click myForm.h.
 * 2) On the View menu, click Properties Window. The Properties pane that displays the properties of the Windows Form appears. For example, the Properties pane displays the properties of the myForm.h file. In the Properties pane, the value of the FileType property is C++ Header File.
 * 3) In the Properties pane, click C++ Form in the FileType drop-down list box.
 * 4) In Solution Explorer, double-click the Windows Form name to view the Windows Form designer of the Windows Form. For example, in Solution Explorer, double-click myForm.h.



STATUS
This behavior is by design.



Steps to reproduce the behavior
 ==== Create a Visual C++ project that contains a Windows Form ====

 Start Microsoft Visual Studio .NET 2003 or Microsoft Visual Studio 2005. On the File menu, point to New, and then click Project. Click Visual C++ Projects under Project Types, and then click Windows Forms Application (.NET) under Templates.

Note In Visual Studio 2005, Visual C++ Projects is changed to Visual C++. Type Exist_project in the Name box.</li> Type a suitable path in the Location box, and then click OK.</li> In Solution Explorer, right-click Exist_project, point to Add, and then click Add New Item. The Add New Item - Exist_project dialog box appears.</li> Under Templates, click Windows Forms Application (.NET).

Note In Visual Studio 2005, Windows Forms Application (.NET) is changed to Windows Forms Application.</li> In the Name box, type myForm.h, and then click Open. The Windows Form designer of the myForm.h file appears.</li></ol> </li> ==== Create a Visual C++ project that uses the existing Windows Form ====

<ol style="list-style-type: lower-alpha;"> On the File menu, point to New, and then click Project.</li> Under Project Types, click Visual C++ Projects, and then click Windows Forms Application (.NET) under Templates.

Note In Visual Studio 2005, Visual C++ Projects is changed to Visual C++.</li> Type New_project in the Name box.</li> Type a suitable path in the Location box, and then click OK.</li> On the View menu, click Solution Explorer.</li> In Solution Explorer, right-click New_project, point to Add, and then click Add Existing Item.

Note In Visual Studio 2005, Add Existing Item is changed to Existing Item.</li> In the Look in box, locate the myForm.h file in the Exist_project folder.</li> Click myForm.h, and then click Open. In Solution Explorer, you notice the myForm.h file in the Header Files folder.</li> In Solution Explorer, double-click myForm.h. You cannot view the Windows Form designer of the myForm.h file.</li></ol> </li></ol>

<div class="references_section">