How can I determine if a selected item has a parent.
I know I can test if a particular selected item has children but I haven't found a test to determine if it is a child.
Another way to say it is how can I determine at what nesting level a selected treeview item reside?
Larry
Turns out it is real simple once you stumble upon the correct portion of the MS documentation.
CONST TV_FIRST = &H1100
CONST TVM_GETNEXTITEM = (TV_FIRST + 10)
CONST TVGN_PARENT = &H3
'tvhand is handle to currently selected node
uint ih=SendMessage(mywin,TVM_GETNEXTITEM,TVGN_PARENT,tvhand ,mytree)
'ih will contain the handle to the parent of the selected item or 0 if there is no parent
Larry
Glad you could help ;)
I was lucky this time.
Most of the time I'm ticked off and not speaking to myself!
Larry
:D