windows form not displaying

D

Dayne

Briefly this is my problem .

I created a windows form on a "parent thread" .. then I called a child
thread 1 to make it visible then hide it on that same thread .. then kill
child thread 1 ... then try to make the form visible on child thread 2 ..
However, the form will not display either on child thread 2 or "parent
thread" ... Any idea why this is? Please help

DT
 
H

Herfried K. Wagner [MVP]

Dayne said:
I created a windows form on a "parent thread" .. then I called a child
thread 1 to make it visible then hide it on that same thread .. then kill
child thread 1 ... then try to make the form visible on child thread 2 ..
However, the form will not display either on child thread 2 or "parent
thread"

Always show your forms in the app's main UI thread. You can use
'Control.Invoke'/'Control.BeginInvoke' to communicate in the thread -> UI
direction.

More information:

Multithreading:

<URL:http://msdn.microsoft.com/library/en-us/dnforms/html/winforms06112002.asp>
<URL:http://msdn.microsoft.com/library/en-us/dnforms/html/winforms08162002.asp>
<URL:http://msdn.microsoft.com/library/en-us/dnforms/html/winforms01232003.asp>

<URL:http://www.devx.com/dotnet/Article/11358/>

<URL:http://msdn.microsoft.com/library/e...SystemWindowsFormsControlClassInvokeTopic.asp>

Multithreading in Visual Basic .NET (Visual Basic Language Concepts)
<URL:http://msdn.microsoft.com/library/en-us/vbcn7/html/vaconthreadinginvisualbasic.asp>

Sample:

<URL:http://dotnet.mvps.org/dotnet/samples/filesystem/downloads/FileSystemEnumerator.zip>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top