Article ID: 836669 - Last Review: November 27, 2007 - Revision: 2.3 Code comments that you add in the InitializeComponent method are lost when you add a control in Visual Studio .NET or in Visual Studio 2005
On This PageSYMPTOMSIn Microsoft Visual Studio .NET or in Microsoft Visual Studio 2005, when you create a Microsoft Windows Application
project, you can add code comments in the InitializeComponent method. However, if
you add a control to the Windows Form later, the code comments that you added previously are
lost. CAUSEWhen you add a control to the Windows Form, the Windows Forms
Designer automatically regenerates the code for the InitializeComponent method. Therefore,
the code comments that you added are lost. MORE INFORMATIONThe code that the Windows Forms
Designer automatically generates contains comments
that appear before the InitializeComponent method. These comments state that you must not use the code editor to modify the
contents of the InitializeComponent method. The following automatically generated code comments appear before the InitializeComponent method in Windows Form class files:
Steps to reproduce the behavior
REFERENCESFor more information about the Windows Forms Designer, visit the following Microsoft
Developer Network (MSDN) Web site: http://msdn2.microsoft.com/en-us/library/e06hs424(vs.71).aspx
(http://msdn2.microsoft.com/en-us/library/e06hs424(vs.71).aspx)
APPLIES TO
| Other Resources Other Support Sites
CommunityGet Help NowArticle Translations
|






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email
Back to the top
