Re: Windows Form Designer generated code
- From: cj <cj@xxxxxxxxxxxxx>
- Date: Mon, 15 Jan 2007 16:51:54 -0500
It's a TCP/IP server program and the control is a 3rd party com object that raises and event when a TCP/IP connection is attempted to the machine. I'd say I want it started only after the program is up and running so I guess form1_load is ok.
Linda Liu [MSFT] wrote:
Hi Cj,.
In VS.NET 2003, the part of 'Windows Form Designer generated code' contains a constructor and the InitializeComponent method, and these code is located in the form.vb file.
In VS 2005, there're some differences. Firstly, the part of 'Window Form Designer generated code' does not contain a constructor. Secondly, these code are moved to a separate file -- form.designer.vb, in order to make the code of the form look neat.
As Martin has suggested, we could add a constructor in the form.vb file by ourselves.
Constructor is called before the Load event handler of the form. You could put your initialization code either in the constructor or the Load event handler of the form. It depends on what kind of the initialization code is.
If you'd like to create an object that has a precedence relation to other objects in the form or do some crucial checking, I suggest that you place the initialization code in the constructor. Otherwise, you could place the code in the constructor or the Load event handler.
Hope this helps.
If you have anything unclear, please feel free to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues where an initial response from the community or a Microsoft Support Engineer within 1 business day is acceptable. Please note that each follow up response may take approximately 2 business days as the support professional working with you may need further investigation to reach the most efficient resolution. The offering is not appropriate for situations that require urgent, real-time or phone-based interactions or complex project analysis and dump analysis issues. Issues of this nature are best handled working with a dedicated Microsoft Support Engineer by contacting Microsoft Customer Support Services (CSS) at http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
- Follow-Ups:
- Re: Windows Form Designer generated code
- From: Linda Liu [MSFT]
- Re: Windows Form Designer generated code
- References:
- Windows Form Designer generated code
- From: cj
- Re: Windows Form Designer generated code
- From: cj
- Re: Windows Form Designer generated code
- From: RobinS
- Re: Windows Form Designer generated code
- From: cj
- Re: Windows Form Designer generated code
- From: Linda Liu [MSFT]
- Windows Form Designer generated code
- Prev by Date: Re: Windows Form Designer generated code
- Next by Date: Re: Startup object
- Previous by thread: Re: Windows Form Designer generated code
- Next by thread: Re: Windows Form Designer generated code
- Index(es):
Relevant Pages
|