Ermittelt die Anzahl der Items
#include <GuiComboBoxEx.au3>
_GUICtrlComboBoxEx_GetCount ( $hWnd )
$hWnd | Handle des Controls |
Erfolg: | die Anzahl der Items |
Fehler: | -1 |
- - - - - - - - Erklärung der Controls - - - - - - - -
#include <GuiComboBoxEx.au3>
#include <GUIConstantsEx.au3>
#include <GuiImageList.au3>
#include <MsgBoxConstants.au3>
Example()
Func Example()
Local $hGui, $hImage, $hCombo
; Erstellt eine GUI
$hGui = GUICreate("ComboBoxEx: Anzahl ermitteln", 400, 300)
$hCombo = _GUICtrlComboBoxEx_Create($hGui, "", 2, 2, 394, 268)
GUISetState(@SW_SHOW)
$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)
_GUICtrlComboBoxEx_SetImageList($hCombo, $hImage)
For $x = 0 To 5
_GUICtrlComboBoxEx_AddString($hCombo, StringFormat("%03d : Zufallstring", Random(1, 100, 1)), $x)
Next
MsgBox($MB_SYSTEMMODAL, "Information", "Anzahl: " & _GUICtrlComboBoxEx_GetCount($hCombo))
; Die Schleife wiederholt sich, bis der Benutzer eine Beenden-Aktion auslöst
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc ;==>Example