You should use a background worker on your application..
the one that will check the
friend withevents Bw1 as new backgroundworker
Private Sub StartButton_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles StartButton.Click
Bw1.RunWorkerAsync()
End Sub
Private Sub Bw1_DoWork(ByVal sender As System.Object, _
ByVal e As System.ComponentModel.DoWorkEventArgs)Handles Bw1.DoWork
End Sub
You can also use system threading