Multi-thread to pupulate data in Vb.net
Posted on 2011-10-06
How can I call a sub from a Timer but process that sub on a new thread?
I need to refresh screen display from a database every second but I want to still be able to drag the form or perform right click etc. on the form without it appearing to be jerky or slow.
The sub that I want to call every reads the database and populates labels and a datagridview on the main page. Currently ths sub is being called from a Timer as a standard call, can this simply be swapped to be a mulit-thread.
I am aware that the labels etc. can only be updated in the original thread what about a datagridview that has been linked to a datatable?