Re: Windows Form Designer generated code



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.

.



Relevant Pages

  • Re: STL map of structures
    ... to add a default constructor and a copy constructor to my structure.". ... Microsoft Online Community Support ... Please feel free to let my manager ... or a Microsoft Support Engineer within 1 business day is acceptable. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Initialize an array of classes?
    ... Currently you cannot use member initialization list for a nonstatic array of a class if it does not have a default constructor. ... however you may encounter the warning C4351 and I do not think that it is useful to use such initialization for an array. ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.languages.vc)
  • RE: Controling form loads and redrawing
    ... I think you could subscribe these events in the form's Load event handler. ... Do you mean that you want to redraw the form after all updates and event ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Object oriented stuff and browsers related thing
    ... with Netscape 2.0 being the first browser to support ... iff MyConstr() is called as a constructor. ... It refers to `MyConstr' as that would be the ...
    (comp.lang.javascript)
  • Re: XmlHttpRequest and Anonymous Method
    ... var xmlHttpRequest; ... not all user agents support them. ... well occur in that constructor. ... Prototype.js was written by people who don't know javascript for people ...
    (comp.lang.javascript)