TreeView_Expand
A version of this page is also available for
4/8/2010
This macro expands or collapses the list of child items, if any, associated with the specified parent item. You can use this macro or send the TVM_EXPAND message explicitly.
Syntax
BOOL TreeView_Expand(
hwnd,
hitem,
flag
);
Parameters
- hwnd
Handle to a tree view control.
- hitem
Handle to the parent item that will be expanded or collapsed.
flag
Action flag. For a list of possible values, see the description of the flag parameter in TVM_EXPAND.Value Description TVE_EXPANDPARTIAL
Child items are visible and parent item's plus symbol is displayed. This flag must be used in combination with the TVE_EXPAND flag.
Return Value
Nonzero indicates that a change took place. Zero indicates otherwise.
Remarks
The TreeView_Expand macro causes the TVN_ITEMEXPANDING and TVN_ITEMEXPANDED messages to be generated if the item being expanded does not have the TVIS_EXPANDEDONCE state bit set. This state gets set when a parent item is expanded for the first time. Using TVE_COLLAPSE and TVE_COLLAPSERESET with TreeView_Expand will cause the TVIS_EXPANDEDONCE state to be reset.
If the item already has the TVIS_EXPANDEDONCE state set, the TreeView_Expand macro does not cause the TVN_ITEMEXPANDING and TVN_ITEMEXPANDED messages to be generated.
Requirements
Header | commctrl.h |
Windows Embedded CE | Windows CE 1.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |