Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual Studio 2003 Initialise Component Question... 2

Status
Not open for further replies.

sqlsamurai

Programmer
May 11, 2005
120
US
I used to be able to add code after InitializeComponent in the contructor for a form in Visual Studio 2003. I'm not sure where this got moved to in Visual Studio 2005. When I look in the partial class for the form I'm able to find the InitializeComponent method but I dont know where its getting called.

I've included screenshots from Visual Studio 2003 and 2005.

Visual Studio 2003 screenshot

Visual Studio 2005 screenshot
 
Where does InitializeComponent get called from in Visual Studio 2005?
 
In both versions, it is called in the constructor. In 2003 version, as soon as you expand the #Region " Windows Form Designer generated code " you see it there. In 2005 version, you navigate to the Form1.Designer.vb and write 'sub new' followed by enter, in order to see the constructor. In 2005 it is not shown by default.
These partial classes can be a little tricky

:)
 
Awesome! Thanks TipGiver, I guess I didnt understand your first answer. :p I tried it and It does work. *nod*
 
Just a side note here - don't manually edit anything in .Designer.vb file as it will be rebuilt (overwriting any changes you make) whenever you add a control or change a property value using the visual designer.


Hope this helps.

[vampire][bat]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top