Defines whether the dropdown portion is hidden when items are added or removed.
C
BOOL WINAPI SftBox_GetRollupOnChange(HWND hwndCtl); void WINAPI SftBox_SetRollupOnChange(HWND hwndCtl, BOOL fSet); void SftBox_RollupOnChangeON(HWND hwndCtl); void SftBox_RollupOnChangeOFF(HWND hwndCtl);
C++
BOOL CSftBox::GetRollupOnChange() const; void CSftBox::SetRollupOnChange(BOOL fSet); void CSftBox::RollupOnChangeON(); void CSftBox::RollupOnChangeOFF();
hwndCtl
The window handle of the combo box control.
fSet
Set to TRUE to hide the dropdown portion when items are added or removed, set to FALSE to leave the dropdown portion shown.
GetRollupOnChange returns the current setting. A value of 1 or greater (TRUE) indicates that the dropdown portion is hidden when items are added or removed. A value of 0 (FALSE) or a negative value indicates that the dropdown portion remains shown.
The GetRollupOnChange and SetRollupOnChange functions define whether the dropdown portion is hidden when items are added or removed.
By default (TRUE), the dropdown portion of a dropdown or dropdown list combo box is hidden whenever the application changes the item list using AddString, InsertString, DeleteString, DeleteDependents, ResetContent, CopyItem, MoveItem, Expand, Collapse or SetItemExpandable (with fExpandable set to FALSE). The dropdown portion is hidden as if the user had canceled the selection, so the SFTBOXN_SELENDCANCEL and SFTBOXN_CLOSEUP notifications are sent.
An application that needs to modify the item list while the dropdown portion is shown (for example to add dependent items when the user expands an item) can suspend this behavior.
RollupOnChangeOFF and RollupOnChangeON are implemented as macros in C and suspend and resume hiding the dropdown portion. RollupOnChangeOFF decrements the current setting by one, RollupOnChangeON increments it by one. Calls to RollupOnChangeOFF and RollupOnChangeON can be nested, but each RollupOnChangeOFF call must be matched by a RollupOnChangeON call.
SftBox_RollupOnChangeOFF(hwndBox);
// add or remove items while the dropdown portion remains shown
SftBox_RollupOnChangeON(hwndBox);The combo box resets the setting to its default (TRUE) when it loses the input focus. An application should use RollupOnChangeOFF and RollupOnChangeON around each group of changes instead of relying on a permanent setting.
The setting has no effect on a simple combo box.
See Also C/C++ API | Categories | Notifications