BackgroundWorker를 이용하여 ProgressBar 사용하기
*
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

이 게시물을

공유하기

SEARCH

MENU NAVIGATION