SftTree/DLL 6.5

Expand

Softel vdm, Inc.

Expands a parent item.

C

BOOL WINAPI SftTree_Expand(HWND hwndCtl,
        int index,
        BOOL fPreserve,
        BOOL fDepth);
BOOL WINAPI SftTreeSplit_Expand(HWND hwndCtl,
        int index,
        BOOL fPreserve,
        BOOL fDepth);

C++

BOOL CSftTree::Expand(int index,
        BOOL fPreserve = TRUE,
        BOOL fDepth = FALSE);
BOOL CSftTreeSplit::Expand(int index,
        BOOL fPreserve = TRUE,
        BOOL fDepth = FALSE);

Parameters

hwndCtl

The window handle of the tree control.

index

The zero-based index of the item to be expanded.  If -1 is specified, all items on level 0 are expanded.

fPreserve

Set to TRUE to restore the expand/collapse state of dependent items made visible, as saved by a previous call to Collapse.  If FALSE is specified, only the item defined by index is expanded and immediate dependents are made visible but remain collapsed.

fDepth

Set to TRUE to expand all dependent items, including non-immediate dependent items.  If TRUE is specified, fPreserve is ignored as all dependents are expanded.

Returns

The return value is TRUE if successful, otherwise FALSE is returned.

Comments

The Expand function expands a parent item.

Expand expands all dependent items of item index and restores the expand/collapse state of all dependent items, as saved by a previous call to Collapse.

If an item is already expanded when using Expand, the item remains unchanged. It does not make any indirect dependents visible.  To make sure that an item's indirect dependents are shown, use Collapse first, which collapses the item (and all dependents), followed by Expand.  Now all dependents are visible.

In a tree control using a virtual data source, this function cannot be used and an error is returned. 

See Also  C/C++ API  |  CategoriesNotifications

 


Feedback / comments / error reports for this topic
© 2009 - Softel vdm, Inc. - www.softelvdm.com