Main Form reference, size

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jim Witt

    Main Form reference, size

    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!


  • Fred Mellender

    #2
    Re: Main Form reference, size

    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.

    "Jim Witt" <JWitt@BayTechE ng.com> wrote in message
    news:1068306459 .695522@rh9cach e...[color=blue]
    > 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!
    >
    >[/color]


    Comment

    Working...