Set the width, in pixels, by which a list box can be scrolled horizontally
#include <GuiComboBox.au3>
_GUICtrlComboBox_SetHorizontalExtent ( $hWnd, $iWidth )
$hWnd | Control ID/Handle to the control |
$iWidth | Specifies the scrollable width of the list box, in pixels |
If the width of the ListBox is smaller than $iWidth, the horizontal scroll bar horizontally scrolls items in the list box.
If the width of the ListBox is equal to or greater than $iWidth, the horizontal scroll bar is hidden or, if the ComboBox has the $CBS_DISABLENOSCROLL style, disabled.
_GUICtrlComboBox_GetHorizontalExtent
#include <GuiComboBox.au3>
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <WindowsConstants.au3>
Example()
Func Example()
; Create GUI
GUICreate("ComboBox Get/Set HorizontalExtent (v" & @AutoItVersion & ")", 420, 296)
Local $idCombo = GUICtrlCreateCombo("", 2, 2, 416, 296, BitOR($CBS_SIMPLE, $CBS_DISABLENOSCROLL, $WS_HSCROLL))
GUISetState(@SW_SHOW)
; Add files
_GUICtrlComboBox_BeginUpdate($idCombo)
_GUICtrlComboBox_AddDir($idCombo, @WindowsDir & "\*.exe")
_GUICtrlComboBox_EndUpdate($idCombo)
; Get Horizontal Extent
MsgBox($MB_SYSTEMMODAL, "Information", "Horizontal Extent: " & _GUICtrlComboBox_GetHorizontalExtent($idCombo))
; Set Horizontal Extent
_GUICtrlComboBox_SetHorizontalExtent($idCombo, 500)
; Get Horizontal Extent
MsgBox($MB_SYSTEMMODAL, "Information", "Horizontal Extent: " & _GUICtrlComboBox_GetHorizontalExtent($idCombo))
; Loop until the user exits.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>Example