TreeView_ExpandTreeView_Expand*
*Contents  *Index  *Topic Contents
*Previous Topic: TreeView_EnsureVisible
*Next Topic: TreeView_GetBkColor

TreeView_Expand


BOOL TreeView_Expand(
    HWND hwndTV,
    HTREEITEM hItem,
    UINT flag
);

Expands or collapses the list of child items associated with the specified parent item, if any. You can use this macro or send the TVM_EXPAND message explicitly.

hwndTV
Handle to a tree view control.
hItem
Handle to the parent item that will be expanded or collapsed.
flag
Action flag. See the description of the flag argument in TVM_EXPAND for a list of possible values.

The TreeView_Expand macro will cause the TVN_ITEMEXPANDING and TVN_ITEMEXPANDED notification 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 will not cause the TVN_ITEMEXPANDING and TVN_ITEMEXPANDED notification messages to be generated.


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.