Accessing a loaded form

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

    Accessing a loaded form

    Hi

    How can I get a handle to a currently loaded form instance and use that to
    call one of form's methods?

    Thanks


  • Armin Zingler

    #2
    Re: Accessing a loaded form

    "John" <John@nospam.in fovis.co.ukschr ieb
    The form is the main form of my app and it has a status bar. I need
    to display text in status bar from various subs in modules outside
    of the form. What is the best mechanism?
    If the code in the modules refer to the Form, you should move the code
    from the modules into the Form. Without the Form, the code won't run
    anyway.

    If you want to write more abstract code, you can cut the relation to the
    Form. Instead, declare and raise an event in the Module. The Form can
    catch the event and update the statusbar.

    Be aware that long running code makes the UI inoperatable. Even short
    running code can lead to inoperatable ghost windows that don't reflect
    changes in your status bar. In this case you should consider executing
    the code in another thread.


    Armin

    Comment

    Working...