update form controls from a class

  • Thread starter Thread starter Grant
  • Start date Start date
G

Grant

Hi,

My main form starts off a worker thread and a watcher thread.

Worker thread iterates through a directory modifying a whole bunch of files
and then saving them.

Watcher thread watches.

I have a progress bar and a text box on the main form which both need
updating while the worker thread is doing its stuff. The worker thread works
in a static class - my question is how to update the form controls while
that worker thread (from the static class) is ploughing through files?

Thanks for any help,
Grant
 
I'd create an event in the 'static' class or pass the static class a
delegate, both of which update the gui. Maybe take a look at
BeginInvoke,EndInvoke and InvokeRequired in the msdn docs too.
 
Back
Top