none
Open new form with new Thread in Winforms C# RRS feed

  • Question

  • hi i m developing a C# software
    and i have a MdiForm and i want to open my child form with a new thread so kindly telll me complete help.... ! how could i open a new form with a new thread....!
    Thursday, July 31, 2008 9:29 AM

All replies

  • I have never tried this with an MDI application.  I have tried putting visual elements in a sepereate thread but I don't think this is generally a good practise.  Unless I misunderstand your objective, you are suggesting having a thread per window in your MDI application.

     

    This would not be an optimum solution because threads have a performance overhead.  Unless you have some special problem to solve it may be better to open the window normally and place any time intensive non-visual operations in a seperate thread.

     

    Judicious use of threads will enhance the user experience by improving the responsiveness of your application.  Overuse can have the opposite effect.

    Thursday, July 31, 2008 11:44 AM
  • All you have to do is use the 'Invoke' method of the MDI form whenever you perform any UI related actions such as showing the child window or manipulating its controls.
    Thursday, July 31, 2008 4:12 PM