JasonD
Member
I use threads a lot in my program, and some people get that CheckForIllegalCrossThread error when loading a form.
This is the way I do my threads at the moment:
Initialization
-
Then at the end of the sub (In this example, 'LoadAccount') I have:
I believe there could be a better way to handle my threads, can you give me a heads up? I have over 6 init's (initializations) in my sources, and new threads are created a lot (Queries).
Thanks
This is the way I do my threads at the moment:
Initialization
-
VB.NET:
Public Sub initLoad()
Dim ThreadX As New Thread(AddressOf LoadAccount)
ThreadX.Start()
End Sub
Then at the end of the sub (In this example, 'LoadAccount') I have:
VB.NET:
Thread.CurrentThread.Abort()
I believe there could be a better way to handle my threads, can you give me a heads up? I have over 6 init's (initializations) in my sources, and new threads are created a lot (Queries).
Thanks