Updating of Winform UI every second

Hi, i have a UI which displays values (Around 40) and i have to update all the 40 values every second as there are chances..the values will be altered at any time. But creating a loop and updating the UI every sec..i figured out it will make the UI super unresponsive..or the UI won't even show up. I have tried using timers for such an app in vb6 and the result was an unresponsive UI. Are there any way i can create multiple threads to update my UI (i.e getting the threads to UI so that load can be shared instead of getting the main app thread to do it all) Some simple code sample would be best or links to resources and case studies regarding this. Thanks
jaxrpcAsked:
Who is Participating?
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Encapsulate your Thread in a Class that raises a custom Event.  When the main form receives the Event, use a Delegate and the Invoke() method to marshal the call from the thread onto your main UI thread.

Here are some examples:
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21741689.html
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21729609.html
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/Q_21702866.html
0
 
AlexFMCommented:
Updating UI evry second by timer doesn't look like complicated task. I think that this is what you should do.
Notice that worker thread cannot update UI directly, it must call UI function using Invoke or BeginInvoke function. Function which updates UI in any case runs in main application thread.
You don't say anything about source of information. Worker thread can do some calculations, read data from some device or socket, but UI is always updated from amin thread.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.