프로그래밍언어/VB.NET

ProgressBar 사용하기 (BackgroundWorker)

부산딸랑이 2014. 3. 9. 02:29

  Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork

        For i = 1 To 100

            Threading.Thread.Sleep(10)

            BackgroundWorker1.ReportProgress(i)

        Next

    End Sub


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        BackgroundWorker1.RunWorkerAsync()

        BackgroundWorker1.WorkerReportsProgress = True


    End Sub


    Private Sub BackgroundWorker1_ProgressChanged(ByVal sender As System.Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs) Handles BackgroundWorker1.ProgressChanged

        ProgressBar1.Value = e.ProgressPercentage


    End Sub

'프로그래밍언어 > VB.NET' 카테고리의 다른 글

배열내 갯수 출력  (0) 2014.03.10
GetPixel 로 불러온값을 Color 로 변환  (0) 2014.03.09
GETpixel 로 색깔가져오기  (0) 2013.11.02
실행된 파일경로  (0) 2013.10.21
ManualResetEvent  (0) 2013.09.24