Microsoft KB Archive/836732

= Controls that you add to a Windows form disappear when you close and reopen the Windows form in Visual C++ .NET 2003 or in Visual C++ 2005 =

Article ID: 836732

Article Last Modified on 1/11/2006

-

APPLIES TO


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

-





SYMPTOMS
You add a control to a Windows form in Microsoft Visual C++ .NET 2003 or in Microsoft Visual C++ 2005, and then you click the Close button (X) to quit Design view. You are prompted to save changes to the header file of the form. Even if you save your changes when you are prompted with a dialog box, and then you reopen the Windows form, you notice that the added control disappears.

Note You notice this problem only if you click the Close button to quit Design view.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section of this article.



WORKAROUND
To work around this problem, use one of the following methods to quit Design view:
 * Switch to Code view, and then switch back to Design view before you click the Close button.
 * On the File menu, click Close.
 * Click the Save button on the toolbar before you click the Close button.



Steps to reproduce the problem

 * 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) Under Project Types, click Visual C++ Projects, and then click Windows Forms Application (.NET) under Templates.

Note In Visual Studio 2005, click Visual C++ under Project Types, and then click Windows Forms Application under Templates.
 * 1) In the Name box, type MyApp, and then click OK.

By default, the Form1 Windows form is created.
 * 1) Add a Button control to the Form1 form.
 * 2) Click the Close button in Design view.
 * 3) To save the changes to the Form1.h file, click Yes in the Microsoft Development Environment dialog box.
 * 4) In Solution Explorer, double-click Form1.h under Header Files. You notice that the Button control that you added in step 5 has disappeared.

Additional query words: Control disappears, IDE Bug, Save button, Close button, control vanishes

Keywords: kbwindowsforms kbide kbuidesign kbdesigner kbforms kbprb kbcontrol kbmanaged KB836732

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.