2020年6月11日 星期四

vb.net 使用BackgroundWorker [Use BackgroundWorker]


1
2
3
4
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
 ' Start up the BackgroundWorker1.
 BackgroundWorker1.RunWorkerAsync()
    End Sub






1
2
3
4
5
6
    Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, _
      ByVal e As System.ComponentModel.DoWorkEventArgs) _
      Handles BackgroundWorker1.DoWork
 ' Do some time-consuming work on this thread.
 System.Threading.Thread.Sleep(1000)
    End Sub


沒有留言:

張貼留言