Function Reference


_GUICtrlComboBox_GetHorizontalExtent

Gets the width, in pixels, that the ListBox of a ComboBox control can be scrolled horizontally

#include <GuiComboBox.au3>
_GUICtrlComboBox_GetHorizontalExtent ( $hWnd )

Parameters

$hWnd Control ID/Handle to the control

Return Value

Returns the scrollable width, in pixels.

Related

_GUICtrlComboBox_SetHorizontalExtent

Example

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

Global $g_idMemo

Example()

Func Example()
    Local $idCombo

    ; Create GUI
    GUICreate("ComboBox Get Horizontal Extent", 400, 296)
    $idCombo = GUICtrlCreateCombo("", 2, 2, 396, 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