HeaderPane
Main
Hide
Share Link
Print

Keyboard & Mouse Interface

This topic describes the keys and mouse actions handled by a combo box control. In a simple or dropdown combo box, the edit control portion has the input focus and handles all keys not listed here, as a standard Windows edit control. In a dropdown list combo box, the static portion has the input focus. The dropdown portion never receives the input focus.

An item selected using the arrow keys, Home, End, PgUp or PgDn becomes the selected item immediately and the SFTBOXN_SELCHANGE notification is sent, whether the dropdown portion is shown or not. If the fSelectEnabledItemsOnly member of the SFTBOX_CONTROL structure is set, disabled items are skipped.

Dropdown List Combo Box - Keys
Down ArrowSelects the next item. If the extended user interface is used (see SetExtendedUI) and the dropdown portion is hidden, the dropdown portion is shown instead.
Up ArrowSelects the previous item.
Left ArrowIf the selected item is expanded, the SFTBOXN_LBUTTONDOWN_BUTTON notification is sent, so the application can collapse the item (GetExpandCollapseIndex returns the item index). Otherwise the parent item is selected, if there is one. If the Shift or Control key is pressed, Left Arrow is equivalent to Up Arrow.
Right ArrowIf the selected item is expandable and not expanded, the SFTBOXN_LBUTTONDOWN_BUTTON notification is sent, so the application can expand the item (GetExpandCollapseIndex returns the item index). Otherwise the first dependent item is selected, if there is one. If the Shift or Control key is pressed, Right Arrow is equivalent to Down Arrow.
HomeSelects the first item.
EndSelects the last item.
PgDnIf the dropdown portion is shown, the selection moves down by the number of items shown in the dropdown portion. If the dropdown portion is hidden, the next item is selected.
PgUpIf the dropdown portion is shown, the selection moves up by the number of items shown in the dropdown portion. If the dropdown portion is hidden, the previous item is selected.
F4Shows or hides the dropdown portion. When hiding, the current selection is accepted. If the extended user interface is used (see SetExtendedUI), the F4 key is ignored.
Alt+Down Arrow
Alt+Up Arrow
Shows or hides the dropdown portion. When hiding, the current selection is accepted.
EnterIf the dropdown portion is shown, the current selection is accepted (SFTBOXN_SELENDOK) and the dropdown portion is hidden. Otherwise the key has no effect.
EscapeIf a mouse action such as resizing the dropdown portion is in progress, it is canceled. Otherwise, if the dropdown portion is shown, it is hidden (SFTBOXN_SELENDCANCEL). A temporary selection made by moving the mouse cursor is discarded and the previously accepted item is selected again (no item is selected if none was accepted before). Otherwise the key is not used by the combo box.
Typed CharactersThe characters are used to locate and select an item, based on the search mode (see SetEditSearchMode and Searching and Autocomplete). While the dropdown portion is hidden, the item found becomes the selected item immediately (SFTBOXN_SELCHANGE). If the fAutoDropOnInput member of the SFTBOX_CONTROL structure is set, the dropdown portion is shown.
Shift+F10The SFTBOXN_CONTEXTMENU_KBD_STATIC notification is sent (see Context Menu).
Simple and Dropdown Combo Box - Keys
Down ArrowSelects the next item. In a dropdown combo box using the extended user interface (see SetExtendedUI), the dropdown portion is shown instead if it is hidden.
Up ArrowSelects the previous item.
Control+HomeSelects the first item. Without the Control key, the Home key is handled by the edit control.
Control+EndSelects the last item. Without the Control key, the End key is handled by the edit control.
PgDnIn a simple combo box and in a dropdown combo box with the dropdown portion shown, the selection moves down by the number of items shown in the dropdown portion. If the dropdown portion is hidden, the next item is selected.
PgUpIn a simple combo box and in a dropdown combo box with the dropdown portion shown, the selection moves up by the number of items shown in the dropdown portion. If the dropdown portion is hidden, the previous item is selected.
F4Dropdown combo box only. Shows or hides the dropdown portion. When hiding, the current selection is accepted. If the extended user interface is used (see SetExtendedUI), the F4 key is ignored.
Alt+Down Arrow
Alt+Up Arrow
Dropdown combo box only. Shows or hides the dropdown portion. When hiding, the current selection is accepted.
EnterDropdown combo box only. If the dropdown portion is shown, the current selection is accepted (SFTBOXN_SELENDOK) and the dropdown portion is hidden. Otherwise the key is not used by the combo box.
EscapeIf a mouse action such as dragging text or resizing the dropdown portion is in progress, it is canceled. Otherwise, if the dropdown portion of a dropdown combo box is shown, it is hidden (SFTBOXN_SELENDCANCEL). A temporary selection made by moving the mouse cursor is discarded and the previously accepted item is selected again (no item is selected if none was accepted before). Otherwise the key is not used by the combo box.
Backspace
Delete
Handled by the edit control. With the search modes SFTBOX_SEARCH_AUTOCOMPLETE and SFTBOX_SEARCH_AUTOCOMPLETE2, the text is not completed for the resulting change (see Searching and Autocomplete).
Typed CharactersHandled by the edit control. As the text changes, the combo box searches for a matching item based on the search mode (see SetEditSearchMode and Searching and Autocomplete). If the fAutoDropOnInput member of the SFTBOX_CONTROL structure is set, the dropdown portion is shown.
Shift+F10The SFTBOXN_CONTEXTMENU_KBD_EDIT notification is sent (see Context Menu). Unless canceled by the application, the popup menu of the edit control is displayed.
All Combo Boxes - Mouse
Dropdown ButtonClicking the dropdown button with the left mouse button shows the dropdown portion, or hides it if it is currently shown. When hiding, the current selection is accepted. If the combo box has no items, the dropdown portion cannot be shown.
Static PortionClicking the item displayed in the static portion of a dropdown list combo box with the left mouse button shows the dropdown portion, or hides it if it is currently shown. When hiding, the current selection is accepted. The click is reported using a notification such as SFTBOXN_MAIN_NOTIFICATION(SFTBOXN_LBUTTONDOWN_CELL). Column headers shown in the static portion can be clicked, resized and reordered as in the dropdown portion.
Edit Control PortionMouse actions are handled by the edit control (caret position, text selection). If dragging is enabled for the edit control portion (see SetDragType), the selected text can be dragged.
Dropdown Portion - Mouse MovementDropdown and dropdown list combo boxes only. If the fCursorSelect member of the SFTBOX_CONTROL structure is set (the default), the item under the mouse cursor is selected temporarily as the mouse cursor moves over the items. Disabled items are skipped if the fSelectEnabledItemsOnly member is set.
Dropdown Portion - Left Mouse ButtonClicking an item selects the item (SFTBOXN_SELCHANGE). In a dropdown or dropdown list combo box, the selection is accepted (SFTBOXN_SELENDOK) and the dropdown portion is hidden when the mouse button is released. The dropdown portion remains shown if the click is on a column header, the row/column header, an expand/collapse button or the tree lines, on a disabled item if the fSelectEnabledItemsOnly member of the SFTBOX_CONTROL structure is set, or if the application sets the fAllowNextRollup member to FALSE while handling the mouse click notification. Each click is reported using a notification such as SFTBOXN_LBUTTONDOWN_TEXT.
Dropdown Portion - Sizing BoxDragging the sizing box (see SetSizeBox) resizes the dropdown portion.
Right Mouse ButtonA context menu notification is sent to the parent window (see Context Menu). The dropdown portion remains shown.
Mouse WheelScrolls the dropdown portion vertically, or horizontally if the Shift key is pressed. The selection does not change.
Losing the Input FocusWhen the combo box loses the input focus, the dropdown portion of a dropdown or dropdown list combo box is hidden (SFTBOXN_SELENDCANCEL). A temporary selection made by moving the mouse cursor is discarded and the previously accepted item is selected again (no item is selected if none was accepted before).

Intercepting Keys

Before a key or character is processed, the combo box sends a WM_NOTIFY message to its parent window with the notification code NM_SFTBOX_KEYDOWN_CODE (structure NM_SFTBOX_KEYDOWN), NM_SFTBOX_KEYUP_CODE (structure NM_SFTBOX_KEYUP) or NM_SFTBOX_CHAR_CODE (structure NM_SFTBOX_CHAR). The fEdit member is TRUE if the key was typed in an edit control portion. If the application sets the fHandled member to TRUE, the key or character is not processed by the combo box, nor by its edit control.

Dialogs

In a dialog, a simple or dropdown combo box processes the Enter and Escape keys only while the dropdown portion of a dropdown combo box is shown. Otherwise these keys are available to the dialog (default button, cancel). A dropdown list combo box always processes the Enter key, so the Enter key does not reach the dialog's default button while the combo box has the input focus. It processes the Escape key only while its dropdown portion is shown or a mouse action is in progress. The Tab key is not used by the combo box.


Last Updated 11/21/2026 - (email)
© 2026 Softel vdm, Inc.