I am fairly new to threading... This is what I do know...
- Other than the main thread all threads need to use Invoke/Begin Invoke to if they are accessing any controls on the UI
- Invoke.IsRequired can be used to check this...
- I can cheat using Control.CheckForIllegalCrossThreadCalls but I would want to get this working the "proper" way and understand what I am doing wrong here...
I cant get the below sub to work... the commented code wont work cause the Sub populates a TreeView control on the form... I tried using delegates but havent used them so I am probably messing up somewhere...
Private Sub GetConfigAndPopulateControls()
'Dim StartThread As New System.Threading.Thread(AddressOf FillMyTreeView)
Private Delegate Sub FillMyTreeViewDelegate()
Private Sub FillMyTreeView()
If Me.InvokeRequired Then
Me.Cursor = Cursors.WaitCursor