TREEVIEW QUESTION

  • Thread starter Thread starter SALIH ATAOZ
  • Start date Start date
S

SALIH ATAOZ

I HAVE A ROOT TREEVIEW NAME=ROOT
THEN A CHILD ROOT CHILD
AND THEN A CHILD OF ROOT CHILD=CHILDOFROOTCHILD

*ROOT
**ROOTCHILD
***CHILDOFROOTCHILD

WHEN I CLICK THE TREE NODES AND SELECT CHILDOFROOTCHILD

IS THERE ANY CODE OF FINDING
LIKE OR LOOK LIKE THIS
ROOT/ROOTCHILD/CHILDOFROOTCHILD
 
* "SALIH ATAOZ said:
I HAVE A ROOT TREEVIEW NAME=ROOT
THEN A CHILD ROOT CHILD
AND THEN A CHILD OF ROOT CHILD=CHILDOFROOTCHILD

*ROOT
**ROOTCHILD
***CHILDOFROOTCHILD

WHEN I CLICK THE TREE NODES AND SELECT CHILDOFROOTCHILD

IS THERE ANY CODE OF FINDING
LIKE OR LOOK LIKE THIS
ROOT/ROOTCHILD/CHILDOFROOTCHILD

Your Shift key doesn't work...

\\\
Me.Label1.Text = t.FullPath
///

('t' is an instance variable pointing to a 'TreeNode'.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
 
HI SALIH,

YES, YOU HAVE TO USE THE PARENT PROPERTY OF EACH NODE AND WORK YOUR WAY
BACKW

Oh it's no use I can't shout like that - it hurts my fingers.

work your way backwards up the tree until you reach the Root Node.

Regards,
Fergus
 
Hi, please don't shout!! We can hear you just fine.

The node has a 'FullPath' property, which can be accessed:

MsgBox(TreeView.SelectedNode.FullPath)

(assuming something *is* selected, otherwise, you'll get an exception)

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

" System.Reflection Master "

==== Converting to 2002 ====
Remove inline declarations
 
first (i dont know how the rest feels on this) i hate CAPSLOCK
but thats beside the point ;p
i dont really know w you want to find out (thats probably me)
but i think you mean something like (you can put it in procedure that
passes a node and a stringbuilder)
Try
dim strTree as string
dim sb as new system.text.stringbuilder
sb.append(trvGroepen.SelectedNode.Text())
sb.append(trvGroepen.SelectedNode.parent.Text(),0)
sb.append(trvGroepen.SelectedNode.parent.parent.Text(),0)
strtree = sb.tostring()
Catch ex As Exception

End Try

hope it helps
eric
 
Fergus,

What a pity you cannot read Herfrieds messages.

Herfried discovered, that Salih has a problem with his keyboard.

:-))

Cor
 
Herfried,
Your Shift key doesn't work...
You never know if he has one, but I did not expect this nice answer from
you.

I did find it the most polite answer on this.
:-))
Cor
 
Hi Herfried,
You got your answer from Eric. J. also

I like this kind of answers, you do if you help him telling that his
keyboard is defect or something, while you know it is probably not, he can
make self his own conclusions.
Where to get a keyboard without a shift key? OK, VB.NET isn't case
sensitive...

I was thinking maybe the OP has maybe an arabic keyboard or something and
did a lot of work to get all those Latin characters on his screen, but maybe
that is to far in thinking.

:-)

Cor
 
I was thinking maybe the OP has maybe an arabic keyboard or something and
did a lot of work to get all those Latin characters on his screen, but maybe
that is to far in thinking.

:-)

Cor

well its not impossible, i thought of that 2 after my reply was long gone
and i saw herfrieds reply :/
(/*defencive mode*/ but i did try to answer the question ;p )

eric
 
* "Cor said:
You got your answer from Eric. J. also

I already saw it.
I was thinking maybe the OP has maybe an arabic keyboard or something and
did a lot of work to get all those Latin characters on his screen, but maybe
that is to far in thinking.

I would be interested in the way those people are developing
applications with VB.NET... They need latin characters to write the
code too. But the reason doesn't matter, maybe he/she has written the
message on a PDA or something similar.

;-)))

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
 
Herfried,

I would write, "Thank you for opeing my eyes", but ms pda have a keyboard,
and palm's are not usable with VB.net.

:-))

Cor
 
You're missing out ;-)

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

" System.Reflection Master "

==== Converting to 2002 ====
Remove inline declarations
 
Back
Top