Hi
I am trying to create (not open) several forms in the background threads
using the code given below at the end.
1. Am I doing it correctly?
2. How can I get handle sot these forms in the calling sub so I can access
these forms after creation.
3. How do I know when threads have finished forms creation so I can show the
form if needed?
Thanks
Regards
Code
====
Private Sub Main()
Dim t1 As New Thread(AddressO f CreateForm)
t1.Start(GetTyp e(Form1))
Dim t2 As New Thread(AddressO f CreateForm)
t2.Start(GetTyp e(Form2))
Dim t3 As New Thread(AddressO f CreateForm)
t3.Start(GetTyp e(Form3))
End Sub
Public Sub CreateForm(ByVa l ft As Object)
Dim t As Type = TryCast(ft, Type)
If Not t Is Nothing Then
Using f As Form = TryCast(Activat or.CreateInstan ce(t, False),
Form)
End Using
End If
End Sub
I am trying to create (not open) several forms in the background threads
using the code given below at the end.
1. Am I doing it correctly?
2. How can I get handle sot these forms in the calling sub so I can access
these forms after creation.
3. How do I know when threads have finished forms creation so I can show the
form if needed?
Thanks
Regards
Code
====
Private Sub Main()
Dim t1 As New Thread(AddressO f CreateForm)
t1.Start(GetTyp e(Form1))
Dim t2 As New Thread(AddressO f CreateForm)
t2.Start(GetTyp e(Form2))
Dim t3 As New Thread(AddressO f CreateForm)
t3.Start(GetTyp e(Form3))
End Sub
Public Sub CreateForm(ByVa l ft As Object)
Dim t As Type = TryCast(ft, Type)
If Not t Is Nothing Then
Using f As Form = TryCast(Activat or.CreateInstan ce(t, False),
Form)
End Using
End If
End Sub
Comment