Illegal cross-thread operation:

  • Thread starter Thread starter oran johnson
  • Start date Start date
O

oran johnson

Illegal cross-thread operation: Control 'PopupInfo' accessed from a thread
other than the thread it was created on.

Can I track this down using the debugger?

Thanks.
 
oran johnson said:
Illegal cross-thread operation: Control 'PopupInfo' accessed from a thread
other than the thread it was created on.

Can I track this down using the debugger?

Well, you shouldn't have too many bits of code accessing a control
anyway - it should be fairly simple to find the bit which is doing it
from the wrong thread.

The above looks like the message from an exception though - why not
just change your exception handling to print out the whole stack trace
rather than just the message?
 
You can't access a control property from one thread that was created on
another.

Create a delegate that is invoked from your new thread but handled on your
main thread. Inside the delegate handler, make the UI changes your require.
 
I would just look at your code for the threads, the figure out which is
accessing "PopupInfo".

You need to setup delegate(s) if you want to access the control from another
thread.
 
Hi,

It should be easy, it's a method that access PopupInfo that that is used
from a thread, see what methods you are using to run threads and start from
there, also do as Jon said.

Note that if you do the same thing ( updating a control from a worker
thread) from more than one point you need to change them all. so even if you
know the s ourc of the current problem you potentialy have more problems
somewhere else.


cheers,
 
Back
Top