VB.NET – Multi Thread

Background worker :

If not bw.IsBusy Then
End If

Friend WithEvents bw As New System.ComponentModel.BackgroundWorker

Private Sub bw_DoWork(sender As System.Object, e As System.ComponentModel.DoWorkEventArgs) Handles bw.DoWork
End Sub

Private Sub bw_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles bw.RunWorkerCompleted

Dim mForm As New Form1()
mForm.TopMost = True
mForm.Owner = Me

End Sub


Delegate :

Dim deleg1 As SomeWorkDelegate = New SomeWorkDelegate(AddressOf AfficherDelegate)

Public Delegate Sub SomeWorkDelegate(ByVal strSomeString As String)

Sub AfficherDelegate()
End Sub

Public Sub FaireDelegate(ByVal someDelegateFunc As SomeWorkDelegate)
Dim mFormChrono As New TempsPasse()
mFormChrono.TopMost = True
mFormChrono.Owner = Me
End Sub



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s