Ermittelt die minimal erlaubte Breite der ListBox der ComboBox
#Include <GuiComboBox.au3>
_GUICtrlComboBox_GetDroppedWidth($hWnd)
Parameter
| $hWnd | Handle des Controls |
Rückgabewert
Erfolg: Die Breite in Pixel
Bemerkungen
Die ComboBox muss den Stil $CBS_DROPDOWN oder $CBS_DROPDOWNLIST aufweisen.
Verwandte Funktionen
_GUICtrlComboBox_SetDroppedWidth, _GUICtrlComboBoxEx_GetDroppedState
Beispiel
#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GUIComboBox.au3>
#include <GuiConstantsEx.au3>
Opt('MustDeclareVars', 1)
$Debug_CB = False ; Prüft den Klassennamen (ClassName), der an die ComboBox/ComboBoxEx-Funktion übergeben wird. Setze dies versuchsweise auf True und verwende dann ein Handle zu einem anderen Control, um die Funktionsweise zu verstehen.
_Main()
Func _Main()
Local $hCombo
; Erstellt eine GUI
GUICreate("ComboBox: Ermittelt Breite der aufgeklappten Liste", 430, 296)
$hCombo = GUICtrlCreateCombo("", 2, 2, 426, 296)
GUISetState()
; Fügt Dateien hinzu
_GUICtrlComboBox_BeginUpdate($hCombo)
_GUICtrlComboBox_AddDir($hCombo, @WindowsDir & "\*.exe")
_GUICtrlComboBox_EndUpdate($hCombo)
; Ermittelt die Breite der aufgeklappten Liste
MsgBox(4160, "Information", "Breite der aufgeklappten Liste: " & _GUICtrlComboBox_GetDroppedWidth($hCombo))
; Die Schleife wiederholt sich, bis der Benutzer die Beenden-Aktion der GUI auslöst
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>_Main