Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Interation Not Working
#8
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:

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


Messages In This Thread
[SOLVED] Interation Not Working - by kismetgerald - 01-18-2012, 01:08 PM
Re: Interation Not Working - by xolara - 01-19-2012, 01:15 PM
Re: Interation Not Working - by kismetgerald - 01-19-2012, 02:46 PM
Re: Interation Not Working - by kismetgerald - 01-19-2012, 05:29 PM
Re: Interation Not Working - by kismetgerald - 01-19-2012, 07:01 PM
Re: Interation Not Working - by kismetgerald - 01-20-2012, 04:30 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  DataBase - Login - Not Working Murcs 4 16,345 07-02-2011, 09:46 AM
Last Post: brandonio21
  Working with Regex xolara 2 11,179 02-24-2011, 05:38 PM
Last Post: xolara

Forum Jump:


Users browsing this thread: 1 Guest(s)