s1ckOh
Well-known member
Hello, I've been trying the following code to get the text from each node in a treeview on form1 (ui thread) from a separate thread in a different class. The msgbox always shows nothing. If someone has a link or an idea on how to go about this, much appreciated.
VB.NET:
[COLOR=blue]Public[/COLOR] [COLOR=blue]Class[/COLOR] [COLOR=#2b91af]something[/COLOR]
[COLOR=blue]
Public Sub[/COLOR] anything()
[COLOR=blue] Dim[/COLOR] xThread [COLOR=blue]As[/COLOR] [COLOR=blue]New[/COLOR] Threading.[COLOR=#2b91af]Thread[/COLOR]([COLOR=blue]AddressOf[/COLOR] whatever)
xThread.Start()[COLOR=blue]
End[/COLOR] [COLOR=blue]Sub[/COLOR] [COLOR=blue]
Sub[/COLOR] whatever() [COLOR=blue]
Dim[/COLOR] test [COLOR=blue]As[/COLOR] [COLOR=blue]String[/COLOR]
[COLOR=blue] For[/COLOR] [COLOR=blue]Each[/COLOR] item [COLOR=blue]As[/COLOR] [COLOR=#2B91AF]TreeNode[/COLOR] [COLOR=blue]In[/COLOR] form1.TreeView1.Nodes
test &= item.Text[COLOR=blue]
Next [/COLOR]
MsgBox(test)
[COLOR=blue] End[/COLOR] [COLOR=blue]Sub
End Class
[/COLOR]