Home All Groups Group Topic Archive Search About

Debugging "form designer" code,

Author
30 Mar 2005 12:51 PM
Robin Tucker
Hi,


I have a problem with my code (somewhere in the InitialiseComponent)
preventing any of my controls being visible in form design mode, although
everything is ok at runtime.  No errors are produced when I view the form in
the designer; it just presents me with a blank form.  Some of the controls
are listed in the properties list, others aren't.  What kind of things can
cause this effect and how can I debug it, given that the VS form designer is
"executing" the new() and InitialiseComponent() on my object, rather than
the debugger?


Thanks,



Robin

Author
30 Mar 2005 1:25 PM
Herfried K. Wagner [MVP]
"Robin Tucker" <idontwanttobespammedanymore@reallyidont.com> schrieb:
> I have a problem with my code (somewhere in the InitialiseComponent)
> preventing any of my controls being visible in form design mode, although
> everything is ok at runtime.  No errors are produced when I view the form
> in the designer; it just presents me with a blank form.  Some of the
> controls are listed in the properties list, others aren't.  What kind of
> things can cause this effect and how can I debug it, given that the VS
> form designer is "executing" the new() and InitialiseComponent() on my
> object, rather than the debugger?

Make sure that all controls are added to the form's 'Controls' collection or
containers' 'Controls' collections in 'InitializeComponent'
('*.Controls.Add'/'*.Controls.AddRange').

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>