Form.Loaded event?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HaLo2FrEeEk
    Contributor
    • Feb 2007
    • 404

    Form.Loaded event?

    The Form.Load event fires before the form is loaded, or as it is being loaded. I want to do some task after the form has been loaded, so that I can display some progress indicator to the user and make it seem like the program hasn't locked up.

    Does such an event exist? Some method that I could use to make sure the form is fully loaded before doing my tasks? The tasks can be pretty long, and right now it does it as the program is starting up, so before the form is actually displayed.

    Any help will be appreciated.
  • Christian Binder
    Recognized Expert New Member
    • Jan 2008
    • 218

    #2
    Maybe you could use the Shown event. This is fired after the form is shown. I don't know if such an event like Loaded exist.

    Comment

    • Curtis Rutland
      Recognized Expert Specialist
      • Apr 2008
      • 3264

      #3
      I would suggest to still use the Loaded event, but rather use a BackgroundWorke r or another thread to do your work for you.

      The problem is, anything done on the UI thread will block the UI thread. So no matter where you do this, any heavy operation will cause the UI to lock up.

      There's an example of using BackgroundWorke r in the link, but I can provide a simpler example if necessary.

      Comment

      Working...