HeaderPane
Main
Hide
Share Link
Print

DroppedWidth

Defines the width of the dropdown portion.

C

int WINAPI SftBox_GetDroppedWidth(HWND hwndCtl);
int WINAPI SftBox_SetDroppedWidth(HWND hwndCtl, int width);

C++

int CSftBox::GetDroppedWidth() const;
int CSftBox::SetDroppedWidth(int width);

Parameters

hwndCtl

The window handle of the combo box control.

width

The width of the dropdown portion.

0The dropdown portion is as wide as the combo box.
Greater than 0The width of the dropdown portion in pixels.
Less than 0The negated value is the width of the dropdown portion as a percentage of the width of the combo box (e.g., -150 for a dropdown portion that is one and a half times as wide as the combo box).

Returns

GetDroppedWidth returns the current width setting of the dropdown portion (see width above). -1 is returned if the combo box is a simple combo box.

SetDroppedWidth returns 0 if the function was successful. -1 is returned if the combo box is a simple combo box.

Comments

The GetDroppedWidth and SetDroppedWidth functions define the width of the dropdown portion.

By default, the dropdown portion is as wide as the combo box (0).

A width defined in pixels is subject to pixel scaling. If pixel scaling is enabled (see SetPixelScaling), the value is scaled by the DPI setting of the monitor.

The setting is used the next time the dropdown portion is shown. The dropdown portion is never made wider than the monitor's work area. If SetDropDownOptimalWidth is used, the dropdown portion can be wider than the width defined here.

If the user resizes the dropdown portion using the resizer (see SetShowResizer), the width setting is replaced by the resulting width in pixels, excluding the borders. Passing this value to SetDroppedWidth restores the width the user defined.

The width of the dropdown portion of a simple combo box is determined by the size of the combo box window.

See Also C/C++ API | Categories | Notifications


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