On Tue, 04 Dec 2007 16:21:35 GMT, "Skysurfer"
<sk****************@libero.itwrote:
>Is it possible to know when a control is added to a form in Design time?
I tryed with ControlAdded, but this is also fired when the program starts.
I want to set some properties only when a control is added to the form and
not when the program starts.
Thanks all.
Skysurfer
Controls that are part of the form are added in the
InitializeComponents method. Add a Sub New to your form and the IDE
will add a call to InitializeComponents in that method. Create a
form level Boolean field that is initially set to False. Set it to
True in New() after the call to InitializeComponents(). In your
OnControlAdded method the field will be True for controls added by the
user.