Main Form reference, size

  • Thread starter Thread starter Jim Witt
  • Start date Start date
J

Jim Witt

How can the Main application form be referred to?

In other words, I would like to get the size of the Main Form. But I
don't know how to instantiate it before:

Application.Run(new MyForm());

Thanks!
 
Replace the Application.Run statement with:

MyForm mF = new MyForm();
Application.Run(mF);


and then save/use the variable mF which points to your main form. You could
make mF a static variable in MyForm class and thus make it available
throughout your application, or some other technique.
 

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

Back
Top