01-19-2012, 07:01 PM
Brandon,
I got some help from Stackoverflow.com () on how to use the BackgroundWorker and it all works fine. Here's the code I'm using:
I got some help from Stackoverflow.com () on how to use the BackgroundWorker and it all works fine. Here's the code I'm using:
Code:
Private connected As Boolean
Private Sub BackgroundWorker1_DoWork(ByVal sender As Object, ByVal e As DoWorkEventArgs) _
Handles BackgroundWorker1.DoWork
While True
Dim online = CheckForInternetConnection()
If online <> connected Then
connected = online
BackgroundWorker1.ReportProgress(CInt(online))
End If
Thread.Sleep(500)
End While
End Sub
Private Sub BackgroundWorker1_ProgressChanged(ByVal sender As Object, ByVal e As ProgressChangedEventArgs) _
Handles BackgroundWorker1.ProgressChanged
Dim online As Boolean = CBool(e.ProgressPercentage)
If online Then
PictureBox4.Image = My.Resources.greenbar
Else
PictureBox4.Image = My.Resources.redbar
Me.Hide()
NoInetConnError.Show()
End If
End Sub
//Kismet