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



The information in this article applies to:

  • Microsoft Visual C++ 2005 Express Edition
  • Microsoft Visual C++ .NET (2003)

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.

MORE INFORMATION

Steps to reproduce the behavior

  1. Create a Visual C++ project that contains a Windows Form

    1. Start Microsoft Visual Studio .NET 2003 or Microsoft Visual Studio 2005.
    2. On the File menu, point to New, and then click Project.
    3. 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++.
    4. Type Exist_project in the Name box.
    5. Type a suitable path in the Location box, and then click OK.
    6. 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.
    7. Under Templates, click Windows Forms Application (.NET).

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

    1. On the File menu, point to New, and then click Project.
    2. 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++.
    3. Type New_project in the Name box.
    4. Type a suitable path in the Location box, and then click OK.
    5. On the View menu, click Solution Explorer.
    6. 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.
    7. In the Look in box, locate the myForm.h file in the Exist_project folder.
    8. Click myForm.h, and then click Open. In Solution Explorer, you notice the myForm.h file in the Header Files folder.
    9. In Solution Explorer, double-click myForm.h. You cannot view the Windows Form designer of the myForm.h file.

REFERENCES

For more information, visit the following Microsoft Developer Network (MSDN) Web sites:

Modification Type:MajorLast Reviewed:1/5/2006
Keywords:kbProperties KbUIDesign kbForms kbWindowsForms kbprb KB843402 kbAudDeveloper