JasonD
Member
Heres a simple example on how to multi-thread your application.
Why Multi-thread?
When you have a critical process that needs to be ran, it may sometimes freeze, lock, or severaly slow down the main thread (form). To get past this, you simply create a new thread for the process to run on.
To get started, you first must import the System Threading
To assign a thread to a process, simple declare something as a New Thread and address it to a Sub.
To start the process, just call ThreadInstance.Start()
But, you dont want the thread to keep going after the form closes, right?
You must set the thread as a background thread, then start it.
Source:
Download
Hope this helps someone new to VB.NET
Why Multi-thread?
When you have a critical process that needs to be ran, it may sometimes freeze, lock, or severaly slow down the main thread (form). To get past this, you simply create a new thread for the process to run on.
To get started, you first must import the System Threading
VB.NET:
Imports System.Threading
VB.NET:
Dim xThread As New Thread(AddressOf SomeSub)
Public Sub SomeSub()
' Your process here
End Sub
VB.NET:
xThread.Start()
You must set the thread as a background thread, then start it.
VB.NET:
xThread.IsBackground = True
xThread.Start()
Download
Hope this helps someone new to VB.NET