One way woudl be to use the Timer control. You could put a timer on the form with an interval of 1000, which equals 1 second. Of course, you could make it shorter, like 500 for every half second. Then you could put the code in that. Be sure to enable the Timer control.