Debugging "form designer" code,

R

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
 
H

Herfried K. Wagner [MVP]

Robin Tucker said:
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').
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top