Defines the horizontal extent (in pixels) of the displayable area.
C
int WINAPI SftBox_GetHorizontalExtent(HWND hwndCtl); BOOL WINAPI SftBox_SetHorizontalExtent(HWND hwndCtl, int width);
C++
int CSftBox::GetHorizontalExtent() const; BOOL CSftBox::SetHorizontalExtent(int width);
hwndCtl
The window handle of the combo box control.
width
The new width (in pixels) of the displayable area. If this parameter is greater than the width of the dropdown portion, the dropdown portion can be scrolled horizontally.
GetHorizontalExtent returns the width of the displayable area in pixels.
SetHorizontalExtent returns TRUE if the function was successful, otherwise FALSE is returned. FALSE is returned if width is negative.
The GetHorizontalExtent and SetHorizontalExtent functions define the horizontal extent (in pixels) of the displayable area.
The displayable area can be wider than the dropdown portion of the combo box control. If the displayable area is wider, the dropdown portion can be scrolled horizontally if the combo box has a horizontal scroll bar (WS_HSCROLL window style). The width of the displayable area can be set by the application using SetHorizontalExtent or by calculating the optimal width using RecalcHorizontalExtent. For performance reasons, the optimal width is not automatically calculated when adding items to a combo box control.
If the width returned is smaller than the actual width of the dropdown portion, it cannot be scrolled horizontally. The horizontal scroll bar will be disabled or hidden, based on the window style SFTBOXSTYLE_DISABLENOSCROLL.
The horizontal extent is also used for the static portion of the combo box control.
SetPixelScaling defines whether width is scaled for the current monitor DPI.
See Also C/C++ API | Categories | Notifications