Threading problem

  • Thread starter Thread starter Tomer
  • Start date Start date
T

Tomer

Hi,

I'm running a thread in my program which creates a form and call its show()
method the form object is stored in a hash table.


For some reason the form doesn't show up, but if I use ShowDialog() the form
does show up but the method that the thread started doesn't finish untill
the form is closed.


Why doesn't is work with the show() method?

Tomer.
 
Only show Forms from the main thread. In theory (I haven't done it) you can
show a Form from another thread and then you *must* touch UI elements of
that Form from the thread it was created on but in practise you run into
trouble (like you just have). Stick to only the main thread displaying and
accessing all UI elements.

Cheers
Daniel
 
Thanks.

Tomer.


Daniel Moth said:
Only show Forms from the main thread. In theory (I haven't done it) you
can show a Form from another thread and then you *must* touch UI elements
of that Form from the thread it was created on but in practise you run
into trouble (like you just have). Stick to only the main thread
displaying and accessing all UI elements.

Cheers
Daniel
 
Back
Top