Click to See Complete Forum and Search --> : Accessing form controls from thread


Morrigu
April 28th, 2004, 04:44 AM
When user clicks on button or something on my GUI, it'll start a thread. When this thread keeps on running, it should access the controls on my UI to give the user some feedback..

I've tried to look into delegates, but I just don't have a clue how to use them like this. The example in MSDN tells me how to create a delegate to a method of a class in the main-class, but I don't understand how to create a delegate to main-class from my own class.

Thanks for any help!

NigelQ
April 30th, 2004, 12:38 AM
Post your own custom messages back to the GUI thread and let it deal with informing the user.

You really don't want two threads accessing the UI controls (potentially at the same time).

Hope this helps,

- Nigel