INVOKE

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there anyway to use the invoke without having it attached to a specific
form or control. As an example I have data that comes from an event on a
working thread and it is directed to a status textbox on whichever form is
active. It is more involved than this but it shows what I am trying to do.
 
It does not matter which control to use. All Invoke does is transfers
execution to the GUI thread. It has nothing to do with the particular
control. This is a bit oversimplified but covers 99% of scenarios
 
Assuming you are following the guidelines of creating all your
controls/forms on the same thread, using the Invoke method of any of them
will marshal to the UI thread. So in your worker class/method make sure you
have a reference to any one of those controls and you are good to go...

Cheers
Daniel
 
Back
Top