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.
 
Back
Top