Funktionreferenz


_GUICtrlComboBoxEx_SetDroppedWidth

Beschreibung anzeigen in

Setzt die Breite der aufgeklappten ListBox der ComboBox in Pixel

#include <GuiComboBoxEx.au3>
_GUICtrlComboBoxEx_SetDroppedWidth ( $hWnd, $iWidth )

Parameter

$hWnd Handle des Controls
$iWidth Die Breite der ListBox in Pixel

Rückgabewert

Erfolg: Die neue Breite der ListBox
Fehler: -1

Bemerkungen

Standardmäßig ist die minimal erlaubte Breite der drop-down ListBox 0.
Die Breite der ListBox ist entweder die minimal erlaubte Breite oder die Breite der ComboBox, je nachdem welche größer ist.

Es ist der Stil $CBS_DROPDOWN oder $CBS_DROPDOWNLIST zu verwenden.

- - - - - - - - Erklärung der Controls - - - - - - - -

Verwandte Funktionen

_GUICtrlComboBoxEx_GetDroppedWidth

Beispiel

#include <GuiComboBoxEx.au3>
#include <GUIConstantsEx.au3>
#include <GuiImageList.au3>
#include <MsgBoxConstants.au3>
#include <WindowsConstants.au3>

Example()

Func Example()
    ; Erstellt eine GUI
    Local $hGUI = GUICreate("ComboBoxEx: Setzt und ermittelt den Index des momentan markierten Items (v" & @AutoItVersion & ")", 700, 300)
    Local $hCombo = _GUICtrlComboBoxEx_Create($hGUI, "", 2, 2, 394, 100, BitOR($CBS_SIMPLE, $WS_VSCROLL, $WS_BORDER))
    GUISetState(@SW_SHOW)

    Local $hImage = _GUIImageList_Create(16, 16, 5, 3)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 110)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 131)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 165)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 168)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 137)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 146)
    _GUIImageList_Add($hImage, _GUICtrlComboBoxEx_CreateSolidBitMap($hCombo, 0xFF0000, 16, 16))
    _GUIImageList_Add($hImage, _GUICtrlComboBoxEx_CreateSolidBitMap($hCombo, 0x00FF00, 16, 16))
    _GUIImageList_Add($hImage, _GUICtrlComboBoxEx_CreateSolidBitMap($hCombo, 0x0000FF, 16, 16))
    _GUICtrlComboBoxEx_SetImageList($hCombo, $hImage)

    _GUICtrlComboBoxEx_InitStorage($hCombo, 100, 320)

    _GUICtrlComboBoxEx_BeginUpdate($hCombo)
    For $x = 0 To 99
        _GUICtrlComboBoxEx_AddString($hCombo, StringFormat("%03d : Zufallstring", $x), Random(0, 8, 1), Random(0, 8, 1), Random(0, 8, 1))
    Next
    _GUICtrlComboBoxEx_EndUpdate($hCombo)

    ; Setzt den Index des momentan markierten Items
    _GUICtrlComboBoxEx_SetCurSel($hCombo, Random(0, 99, 1))

    ; Ermittelt den Index des momentan markierten Items
    MsgBox($MB_SYSTEMMODAL, "Information", "Current Sel: " & _GUICtrlComboBoxEx_GetCurSel($hCombo))

    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>Example