Treeview problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i have a treeview1 control and i want to do this:

i dont want to focus or select a node code is here

if treeview1.selectednode.text="" then
msgbox ("Empty")
else
msgbox("Not Empty")
end if

but this results error it feels treeview1 = nothing and give error
nullreferenceexceptions
object reference not set to an instance of an object
how can i solve this is there a way
 
Bafidi,

If you use the treeview, than it is very important to tell in what event you
are somehing using. Almost all events fire at initializing so probably is
that the reason of your error.

Cor
 
i put a button1 on the form and click the button
but i dont select a node in treeview1
after click the button i want to see message box

empty

or not empty

so if its empty i want to focus on treeview1 and select a node again

if the
 
Bafidi,

This will give an error if it is not selected (I been gone often in that
hole).

I thought that a test on
if Not treeview1.selectednode Is Nothing then
'will go
end if

Cor
 
Back
Top