Hi,
I'm current having a problem with the treeview control and multi
threading. The treeview is on a form. A request is then sent to a
server using IP for the data. The data arrives in an event on a
different thread. I have used delegates to allow me to add to the
treeview and it all works fine. I cant however seem to set the
"SelectedNode" property or the treeview. I have tried directly and
also using a delegate. I all cases, the UI freezes for a while, then
the thread times out.
Below is a snippet of the code I have already. Does anyone have any
ideas? Any help is very much appreciated. In the
"SelectTreeviewRootNode" call, I have tried using the passed in
treeview, and the actual name of the one on the form, but neither
works.
Delegate Sub TreeViewSelectRootNodeDelegate(ByVal trvTreeview
As TreeView)
Private mdgtSelectRootNode As New
TreeViewSelectRootNodeDelegate(AddressOf SelectTreeviewRootNode)
Private Sub SelectTreeviewRootNode( _
ByVal trvTreeview As TreeView)
tvwMain.SelectedNode = tvwMain.Nodes(0)
End Sub
tvwMain.Invoke(mdgtSelectRootNode, New Object() {tvwMain})
Cheers
Bobby Owens
Bo*********@ntlworld.com