Defines the display style of the selected item when the combo box control does not have the input focus.
C
int WINAPI SftBox_GetNoFocusStyle(HWND hwndCtl); void WINAPI SftBox_SetNoFocusStyle(HWND hwndCtl, int NoFocusStyle);
C++
int CSftBox::GetNoFocusStyle() const; void CSftBox::SetNoFocusStyle(int NoFocusStyle);
hwndCtl
The window handle of the combo box control.
NoFocusStyle
A value describing the display style of the selected item when the combo box does not have the input focus:
| SFTBOX_NOFOCUS_KEEPSEL | The selected item is drawn the same way as for a combo box that has the input focus. If a rounded selection outline rectangle is used (see SFTBOX_SELECTION_OUTLINE), the colors used are defined using the nofocusOutlineBorder, nofocusInnerBorder, nofocusInnerFill1 and nofocusInnerFill2 members of the SFTBOX_COLORS structure. Otherwise, the colorSelBgNoFocus and colorSelFgNoFocus members are used. If these colors are identical to the colors selectionOutlineBorder, selectionInnerBorder, selectionInnerFill1, selectionInnerFill2 or colorSelBg and colorSelFg, the user cannot distinguish between the selected item in a combo box with the input focus and a combo box without the input focus. |
| SFTBOX_NOFOCUS_FRAME | The selected item is drawn as an item that is not selected, but is framed by a rectangle drawn using the color specified by the colorSelBg member of the SFTBOX_COLORS structure. If a rounded selection outline rectangle is used (see SFTBOX_SELECTION_OUTLINE), SFTBOX_NOFOCUS_FRAME is identical to SFTBOX_NOFOCUS_KEEPSEL. |
| SFTBOX_NOFOCUS_NOTHING | The selected item is drawn as an item that is not selected. This is the default. |
GetNoFocusStyle returns a value describing the display style of the selected item when the combo box control does not have the input focus.
The GetNoFocusStyle and SetNoFocusStyle functions define the display style of the selected item when the combo box control does not have the input focus.
The style defined applies to the selected item shown in the static portion of a dropdown list combo box. In a simple combo box, it also applies to the selected item in the dropdown portion. Until SetNoFocusStyle is called, the dropdown portion of a simple combo box shows the selected item as selected (SFTBOX_NOFOCUS_KEEPSEL).
If a value other than SFTBOX_NOFOCUS_KEEPSEL, SFTBOX_NOFOCUS_FRAME or SFTBOX_NOFOCUS_NOTHING is specified, SFTBOX_NOFOCUS_KEEPSEL is used.
In a dropdown combo box and a dropdown list combo box, the selected item in the dropdown portion is always shown as selected while the dropdown portion is displayed.
The selection colors can be defined using SetCtlColors.
See Also C/C++ API | Categories | Notifications