IonicWind Software

IWBasic => GUI Central => Topic started by: LarryMc on August 01, 2009, 11:37:46 AM

Title: Treeview control parent items
Post by: LarryMc on August 01, 2009, 11:37:46 AM
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
Title: Re: Treeview control parent items
Post by: LarryMc on August 01, 2009, 12:20:10 PM
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
Title: Re: Treeview control parent items
Post by: ZeroDog on August 01, 2009, 07:12:44 PM
Glad you could help  ;)
Title: Re: Treeview control parent items
Post by: LarryMc on August 01, 2009, 09:11:04 PM
I was lucky this time.

Most of the time I'm ticked off and not speaking to myself!

Larry
Title: Re: Treeview control parent items
Post by: ZeroDog on August 01, 2009, 10:52:57 PM
 :D