Window as seperate thread.
-
I want to open a child window on a seperate thread, from a parent window. The code in parent window should execute seperately and the code in child window should execute seperately. I tried it using multithreading but couldn't do it. I was able to execute functions as seperate thread but not entire window. I hope this can be done.
Errors are like Mini Skirts, shorter they get, more revealing they become.
-
I want to open a child window on a seperate thread, from a parent window. The code in parent window should execute seperately and the code in child window should execute seperately. I tried it using multithreading but couldn't do it. I was able to execute functions as seperate thread but not entire window. I hope this can be done.
Errors are like Mini Skirts, shorter they get, more revealing they become.
Can't be done. All Windows, Forms, Controls must be created and manipulated by the main thread only; if you need additional threads, they should not touch the Controls, instead they should use the Control.InvokeRequired/Invoke pattern to tell the main thread to read or write Control properties and call Control methods in their behalf. Anything else is bound to fail, either immediately, or at some later time, with often mysterious phenomena such as disappearing menu bars, windows "Not responding" and much more. :)
Luc Pattyn [Forum Guidelines] [My Articles]
Fixturized forever. :confused: