Hallo Leute,
ist vielleicht ein absolutes Idioten-Problem, aber das plumpe Anwenden der GUICtrlCreateCombo-Parameter hilft mir nicht.
Von anderen Controls kenne ich es nur so, dass ich die Größe per width und height definieren kann.
Bei GUICtrlCreateCombo funktioniert es nicht. Das angepasste Beispiel soll das zeigen:
AutoIt
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
Example()
Func Example()
; Create a GUI with various controls.
Local $hGUI = GUICreate("Example", 300, 200)
; Create a combobox control.
Local $idComboBox = GUICtrlCreateCombo("Item 1", 10, 10, 185, 20)
Local $idComboBox2 = GUICtrlCreateCombo("Item 1", 10, 40, 185, 60)
Local $idComboBox3 = GUICtrlCreateCombo("Item 1", 10, 80, 185, 520)
Local $idComboBox4 = GUICtrlCreateCombo("Item 1", 10, 120, 185, 120)
Local $idClose = GUICtrlCreateButton("Close", 210, 170, 85, 25)
; Add additional items to the combobox.
GUICtrlSetData($idComboBox, "Item 2|Item 3", "Item 2")
GUICtrlSetData($idComboBox2, "Item 2|Item 3", "Item 2")
GUICtrlSetData($idComboBox3, "Item 2|Item 3", "Item 2")
GUICtrlSetData($idComboBox4, "Item 2|Item 3", "Item 2")
; Display the GUI.
GUISetState(@SW_SHOW, $hGUI)
Local $sComboRead = ""
; Loop until the user exits.
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE, $idClose
ExitLoop
Case $idComboBox
$sComboRead = GUICtrlRead($idComboBox)
MsgBox($MB_SYSTEMMODAL, "", "The combobox is currently displaying: " & $sComboRead, 0, $hGUI)
EndSwitch
WEnd
; Delete the previous GUI and all controls.
GUIDelete($hGUI)
EndFunc ;==>Example
Alles anzeigen
Wie funktioniert es?