Imports System
Imports System.Threading
Public Class Form1
Dim Str_Query As String
Dim Int_TotalRows As Integer
Private Sub ThreadStart()
Dim strReturn As String
Dim display As New Action(Of String)(AddressOf AddTextByDispatcher)
'*** Process in Thread
'*** Process in Thread
strReturn = "String Return"
Dispatcher.BeginInvoke(New AddTextDelegate(AddressOf AddTextByDispatcher), strReturn)
'*** Process in Thread
'*** Process in Thread
End Sub
Private Delegate Sub AddTextDelegate(ByVal text As String)
Private Sub AddTextByDispatcher(ByVal strReturn As String)
Me.txtResult.Text = strReturn
End Sub
Private Sub BtnProcess_Mem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnProcess_Mem.Click
Dim thread As New Thread(AddressOf ThreadStart)
thread.Start()
End Sub