Hi, normally when i deal with treeviews that have more then one level, i can get the parent of the child by doing something like:
ShowMessage(TreeView1.Selected.Parent.Text);
if say i know it is 2 levels down the tree i would use:
ShowMessage(TreeView1.Selected.Parent.Parent.Text);
which would get the root parents text.
BUT, what if i dont know how many levels the tree has, how would i always get the top most node parent?
Thanks!
ShowMessage(TreeView1.Selected.Parent.Text);
if say i know it is 2 levels down the tree i would use:
ShowMessage(TreeView1.Selected.Parent.Parent.Text);
which would get the root parents text.
BUT, what if i dont know how many levels the tree has, how would i always get the top most node parent?
Thanks!