A BackgroundWorker runs an asyncron thread for you.
Private WithEvents backgroundWorker1 As New System.ComponentModel.BackgroundWorker
' Start the BackgroundWorker
Public Sub RunAbackgroundworker()
If Not backgroundWorker1.IsBusy Then
backgroundWorker1.RunWorkerAsync()
End If
End Sub
Dim i As Integer = 0
Private Sub backgroundWorker1_DoWork(ByVal sender As Object, ByVal e As _
System.ComponentModel.DoWorkEventArgs) Handles backgroundWorker1.DoWork
i = 0
Do
i += 1
If i > 100 Then
Exit Do
End If
System.Threading.Thread.Sleep(50)
Loop
End Sub
Private Sub backgroundWorker1_RunWorkerCompleted(ByVal sender As Object, _
ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles _
backgroundWorker1.RunWorkerCompleted
MsgBox("We are done now!")
End Sub
Subscribe to:
Post Comments (Atom)
MySQL to MariaDB
Here is a good description how to migrate to MariaDb MySQL to MariaDb Example of how to dump data from MySQL port=3307: mysqldump --user=ro...
-
When converting an VB2008 application to VB2010 I run into trouble regarding COM objects while compiling. you get errors like: Error 1...
-
In a module you have declared a Structure or Enum that you will use through out a project. Module Module1 Public Structure dummy ...
-
Apache2 crashes on Ubuntu Linux 22.04.5 after Zabbix was updated to 7.0.26 During a upgrade of my Ubuntu server there was a new package for ...
No comments:
Post a Comment