hi,
i would like to know how to run a complete form with its controls in a seperate thread as my main thread!?
i have test the following, but it does not work:
it only works like this:
so i simulate application.run with a doevents loop...is that ok, or is there a better way?
i would like to know how to run a complete form with its controls in a seperate thread as my main thread!?
i have test the following, but it does not work:
Code:
Imports System.Threading
Public Class Form1
Dim thread As Thread
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
thread = New Thread(AddressOf startform)
thread.IsBackground = True
thread.Start()
End Sub
Private Sub startform()
Dim newform As New Form2
newform.Show()
End Sub
End Class
it only works like this:
Code:
Imports System.Threading
Public Class Form1
Dim thread As Thread
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
thread = New Thread(AddressOf startform)
thread.IsBackground = True
thread.Start()
End Sub
Private Sub startform()
Dim newform As New Form2
newform.Show()
do
Application.DoEvents()
loop
End Sub
End Class
so i simulate application.run with a doevents loop...is that ok, or is there a better way?