Design time errors

C

Clive Dixon

I'm looking for any information on precisely what the IDE does when opening
a form in design mode. I'm pulling my hair out trying to fix some bizarre
design-time errors screwing up some forms, and it would help if I knew
precisely how the IDE creates and initializes the form and what methods are
called. For example: Does it run a constructor? Does the form have to have a
default constructor? What happens if the form does not have a default
constructor? Does the IDE just in effect bypass the constructor and just
call InitializeComponent? Does it call OnLoad? etc. etc.

Thanks for any info on this.

======================
Clive Dixon
Digita Ltd. (www.digita.com)
 
B

Bob Powell [MVP]

The form is an odd case. You can't compile the form code on the fly all the
time because it may be full of unfinished thoughts at any given moment so in
fact the designer uses a generic Form object and populates the Controls list
in the dummy from the data stored in the InitializeComponent method. If your
form's constructor or load events etc do something clever, you won't see
that at design time.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 

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