views:

205

answers:

3

i know the way that uses the Control.InvokeRequired() and Control.Invoke().

but i was wondering if its possible to use some other method to alert the ui thread that the Data was changed and then let the ui thread update its controls without using control.invoke().

as far as i remember this was possible before in mfc by sending messages to the main window so i am wondering if something similar exists in windows forms.

+3  A: 

That is exactly what Invoke is doing.

Here is a little more information for the curious: http://weblogs.asp.net/justin%5Frogers/pages/126345.aspx

John Gietzen
+2  A: 

invoke/begininvoke is implemented by sending message.

Codism
+1  A: 

You could use a Timer to check fields your worker thread is writing to periodically, updating the UI if necessary. That timer runs on the UI thread, so doesn't have to invoke.

This is awful a horrible idea and I'm going to punish myself now for suggesting it.

Will
actually i implemented the program that way. maybe its not good but its fast and to the point :)
Karim
See, now I have to delete this answer. This is such a friggen bad design I feel sick. Urp. ATTENTION PEOPLE FROM GOOGLE! Do not do this! This sucks!
Will
Can't delete the accepted answer.
Will