mhdhallak
asked on
how to show a modeless form from a thread
hi
did anybody try to show a form from within a running thread? The form's object is declared as a member of the class that owns the thread and is initialized in the class's constructor. now in the thread's delegate, i call the show method (frm.Show()). Conceptually, since its a modeless show, the form should appear and tne tnread should go on with its work. however, just the border and the title of the form appear but nothing is drawn in the form.
why is that? is there any workaround solution?
did anybody try to show a form from within a running thread? The form's object is declared as a member of the class that owns the thread and is initialized in the class's constructor. now in the thread's delegate, i call the show method (frm.Show()). Conceptually, since its a modeless show, the form should appear and tne tnread should go on with its work. however, just the border and the title of the form appear but nothing is drawn in the form.
why is that? is there any workaround solution?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Use:
Application.Run(aForm) ;
inside thread and all work!!
Application.Run(aForm) ;
inside thread and all work!!
Take a look on this UI Threading Helper Classes, may be you can get something for your implementation
http://weblogs.asp.net/rosherove/articles/7171.aspx