|
|
|
ItemStatus |
Defines an item's enabled/disabled status.
C
BOOL WINAPI SftTree_GetItemStatus(HWND hwndCtl, int index); BOOL WINAPI SftTree_SetItemStatus(HWND hwndCtl, int index, BOOL fEnable); BOOL WINAPI SftTreeSplit_GetItemStatus(HWND hwndCtl, int index); BOOL WINAPI SftTreeSplit_SetItemStatus(HWND hwndCtl, int index, BOOL fEnable);
C++
BOOL CSftTree::GetItemStatus(int index) const; BOOL CSftTree::SetItemStatus(int index, BOOL fEnable = TRUE); BOOL CSftTreeSplit::GetItemStatus(int index) const; BOOL CSftTreeSplit::SetItemStatus(int index, BOOL fEnable = TRUE);
Parameters
hwndCtl
The window handle of the tree control.
index
The zero-based index of the item for which the enabled/disabled status is to be retrieved or set.
fEnable
Set to TRUE to enable the item, set to FALSE to disable the item.
Returns
GetItemStatus returns a value indicating the current enabled/disabled status of the specified item. TRUE if the item is enabled, FALSE if the item is disabled or -1 is returned if an error occurred.
SetItemStatus returns TRUE if the function was successful, otherwise FALSE is returned.
Comments
The GetItemStatus and SetItemStatus functions define an item's enabled/disabled status.
If an item is disabled, it is drawn in a "grayed" manner indicating its status. Except for the visual difference, a disabled item is treated exactly like an enabled item. It is up to the application to implement a different behavior if an item is disabled.
It is possible to prevent a user from selecting disabled items using SFTTREE_CONTROL, fSelectEnabledItemsOnly.
In
a tree control using a virtual data source,
SetItemStatus cannot be used and an error is returned. The fEnabled
member of the SFTTREE_ITEM structure is
used instead.
See Also C/C++ API | Categories | Notifications