|
-
October 22nd, 2002, 09:54 AM
#1
please try it...see what happens...is it a bug?
hi,
i have a problem with modeless forms...
When i click a button and execute the code below it works...
onclickButton()
{
..
FormX MyForm=new FormX();
MyForm.Show(); // it creates a modeless form as expected!..
..
}
but when i call these two lines of code in another function such as a CallBack function like OnReceiveAsync() in my Client program or in a timer delegate function like Timer_Elapsed() it doesn't works...
it tries to create MyForm but it does not properly appears and it locks the whole program..
is it a bug? or should i do something else for Modeless forms & dialogs..
Please try it your self and see what happens..
Modal forms (MyForm.ShowDialog()
works properly everywhere whether called by clicking on buttons or
calling via another function
but why modeless are not?..
Thanks for ur help...
-
October 22nd, 2002, 03:15 PM
#2
Winforms doesnt work very well with multiple threads. You are required to ensure that all GUI operations happen on the same thread the main window was created on. To do this, look into the Control.Invoke method.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|