Function Reference

_GUICtrlComboSetHorizontalExtent

Set the width, in pixels

#Include <GuiCombo.au3>
_GUICtrlComboSetHorizontalExtent($h_combobox, $i_width)

 

Parameters

$h_combobox control id/control hWnd
$i_width Specifies the scrollable width of the list box, in pixels

 

Return Value

None.

 

Remarks

An application sends the $CB_SETHORIZONTALEXTENT message to set the width,
in pixels, by which a list box can be scrolled horizontally (the scrollable width).

If the width of the list box is smaller than this value, the horizontal scroll bar
horizontally scrolls items in the list box.

If the width of the list box is equal to or greater than this value, the horizontal
scroll bar is hidden or, if the combo box has the $CBS_DISABLENOSCROLL style, disabled.

 

Related

_GUICtrlComboGetHorizontalExtent

 

Example


#include <GuiConstants.au3>
#include <GuiCombo.au3>

Opt('MustDeclareVars',1)

Dim $Combo,$Btn_Exit,$Status,$msg

GuiCreate("ComboBox Set Horizontal Extent", 392, 254)

$Combo = GuiCtrlCreateCombo("", 70, 10, 100, 150,BitOR($CBS_SIMPLE,$CBS_DISABLENOSCROLL,$WS_HSCROLL))
GUICtrlSetData($Combo,"AutoIt v3 is freeware BASIC-like scripting language designed for automating the Windows GUI.|" & _
                             "It uses a combination of simulated keystrokes mouse movement and window/control manipulation|" & _
                             "in order to automate tasks in a way not possible or reliable with other languages|" & _
                             "(e.g. VBScript and SendKeys).")
$Btn_Exit = GuiCtrlCreateButton("Exit", 150, 180, 90, 30)
$Status = GUICtrlCreateLabel("",0,234,392,20,BitOR($SS_SUNKEN,$SS_CENTER))
_GUICtrlComboSetHorizontalExtent($Combo, 500)
GUICtrlSetData($Status,"Horizontal Extent: " & _GUICtrlComboGetHorizontalExtent($Combo))
GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit
            ExitLoop
    EndSelect
WEnd
Exit