update form controls from a class

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
 
J

john doe

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.
 

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