G
Guest
Okay, I'm sure there is a very simple solution to my problems here and I am
just too tired, but then again maybe not.
Here is an example of my code:
Dim Conn_Thrd as new system.threading.thread(addressof connecttoserver())
public sub connecttoserver()
'This works good
Treeview1.nodes.add("Test Node")
'This doesnt
clrnd()
'Neither does this
me.treeview1.invoke(clrnd)
end sub
'This ONLY works good when it is called inside the thread containing the
treeview1 control.
public function clrnd()
Treeview1.nodes.clear()
end sub
'This works good
Private sub Button1_click (...) handles button1.click
clrnd()
end sub
'This works good
Private sub Button2_click (...) handles button2.click
Conn_Thrd = new system.threading.thread(addressof connecttoserver())
Conn_Thrd.start()
end sub
Please help
Thanks,
Travis
just too tired, but then again maybe not.
Here is an example of my code:
Dim Conn_Thrd as new system.threading.thread(addressof connecttoserver())
public sub connecttoserver()
'This works good
Treeview1.nodes.add("Test Node")
'This doesnt
clrnd()
'Neither does this
me.treeview1.invoke(clrnd)
end sub
'This ONLY works good when it is called inside the thread containing the
treeview1 control.
public function clrnd()
Treeview1.nodes.clear()
end sub
'This works good
Private sub Button1_click (...) handles button1.click
clrnd()
end sub
'This works good
Private sub Button2_click (...) handles button2.click
Conn_Thrd = new system.threading.thread(addressof connecttoserver())
Conn_Thrd.start()
end sub
Please help
Thanks,
Travis