# Function Reference

# _GUICtrlComboBox_SetDroppedWidth

Set the maximum allowable width, in pixels, of the ListBox of a ComboBox

#include <GuiComboBox.au3>
_GUICtrlComboBox_SetDroppedWidth ( $hWnd, $iWidth )

## Parameters

$hWnd | Control ID/Handle to the control
$iWidth | The width of the ListBox, in pixels

## Return Value

Success: | the new width of the ListBox.
Failure: | -1.

## Remarks

By default, the minimum allowable width of the drop-down ListBox is zero.
The width of the ListBox is either the minimum allowable width or the ComboBox width, whichever is larger.
Use $CBS_DROPDOWN or $CBS_DROPDOWNLIST style.

## Related

_GUICtrlComboBox_GetDroppedWidth, _GUICtrlComboBoxEx_GetDroppedState

## Example

    #include <GuiComboBox.au3>
    #include <GUIConstantsEx.au3>
    #include <MsgBoxConstants.au3>

    Example()

    Func Example()
        ; Create GUI
        GUICreate("ComboBox Get/Set Dropped Width (v" & @AutoItVersion & ")", 420, 296)
        Local $idCombo = GUICtrlCreateCombo("", 2, 2, 416, 296)
        GUISetState(@SW_SHOW)

        ; Add files
        _GUICtrlComboBox_BeginUpdate($idCombo)
        _GUICtrlComboBox_AddDir($idCombo, @WindowsDir & "\*.exe")
        _GUICtrlComboBox_EndUpdate($idCombo)

        ; Set Dropped Width
        _GUICtrlComboBox_SetDroppedWidth($idCombo, 500)

        ; Get Dropped Width
        MsgBox($MB_SYSTEMMODAL, "Information", "Dropped Width: " & _GUICtrlComboBox_GetDroppedWidth($idCombo))

        ; Loop until the user exits.
        Do
        Until GUIGetMsg() = $GUI_EVENT_CLOSE
        GUIDelete()
    EndFunc   ;==>Example