-
April 30th, 2001, 05:26 AM
#1
CTreeCtrl and expanded nodes
Hi all,
Im probably missing something basic here, but does anyone know how i can test to see if a tree item node is currently expanded or not?
Thanks
Neil
-
April 30th, 2001, 06:05 AM
#2
Re: CTreeCtrl and expanded nodes
if (GetItemState(hItem, TVIS_EXPANDED) & TVIS_EXPANDED)
{
// hItem is expanded
}
else
// hItem is collapsed
I've seen GetItemState return MORE states than the ones I asked it for, I've made it a habit to explicitly test the returned state again (sigh), hence the "& TVIS_EXPANDED" which shouldn't be required.
-
March 13th, 2013, 03:57 PM
#3
Re: CTreeCtrl and expanded nodes
Originally Posted by OReubens
if (GetItemState(hItem, TVIS_EXPANDED) & TVIS_EXPANDED)
{
// hItem is expanded
}
else
// hItem is collapsed
I've seen GetItemState return MORE states than the ones I asked it for, I've made it a habit to explicitly test the returned state again (sigh), hence the "& TVIS_EXPANDED" which shouldn't be required.
Thank you. I had just this problem and why your post had shown on a search. Fixed it in my ctrlext.ini as:
CTLEXT_INLINE bool CTreeCursor::IsExpanded( ) const { return TreeView_GetItemState( *m_pTree, m_hTreeItem, TVIS_EXPANDED ) & TVIS_EXPANDED; }
Best, Dan.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|