Defines whether an item is expandable.
C
BOOL WINAPI SftBox_GetItemExpandable(HWND hwndCtl, int indexTC); BOOL WINAPI SftBox_SetItemExpandable(HWND hwndCtl, int indexTC, BOOL fExpandable);
C++
BOOL CSftBox::GetItemExpandable(int indexTC) const; BOOL CSftBox::SetItemExpandable(int indexTC, BOOL fExpandable);
hwndCtl
The window handle of the combo box control.
indexTC
The zero-based index of the item for which the expandable status is to be retrieved or set.
fExpandable
Set to TRUE to make the item an expandable item or FALSE to collapse the item and delete all dependents.
GetItemExpandable returns TRUE if the item is expandable, otherwise FALSE.
SetItemExpandable returns TRUE if the function was successful, otherwise FALSE is returned.
The GetItemExpandable and SetItemExpandable functions define whether an item is expandable.
Normally, only a parent item (with dependents) is expandable. Instead of adding dependent items, an item can be made expandable using the SetItemExpandable function. An expandable item displays an expand/collapse button (if enabled using SetShowButtons or SetShowButton0) and displays a suitable item picture.
An item without dependents can be made a "temporary" parent item by using SetItemExpandable(TRUE). The item now displays an expand/collapse button and other attributes, such as the item picture, even though no dependents are present. The application can add dependent items as the user expands this "temporary" parent item (see the SFTBOXN_LBUTTONDOWN_BUTTON notification and GetExpandCollapseIndex), making it into a real parent item.
When using SetItemExpandable(TRUE) and the item already has dependents, the item remains unchanged.
When using SetItemExpandable(FALSE), the item's dependents are deleted. If the dropdown portion of a dropdown or dropdown list combo box is visible, it is hidden. This can be suppressed using SetRollupOnChange.
In a combo box control using a virtual data source, SetItemExpandable cannot be used and an error is returned.
See Also C/C++ API | Categories | Notifications