Ermittelt den 0-basierenden Index des ersten sichtbaren Items in der ListBox der ComboBox
#include <GuiComboBox.au3>
_GUICtrlComboBox_GetTopIndex ( $hWnd )
$hWnd | Control-ID / Handle des Controls |
Erfolg: | Der Index des ersten sichtbaren Items in der ListBox der ComboBox |
Fehler: | -1 |
- - - - - - - - Erklärung der Controls - - - - - - - -
#include <GuiComboBox.au3>
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <WindowsConstants.au3>
Example()
Func Example()
; Erstellt eine GUI
GUICreate("ComboBox: Setzt und ermittelt den Top Index (v" & @AutoItVersion & ")", 500, 296)
Local $idCombo = GUICtrlCreateCombo("", 2, 2, 396, 296, BitOR($CBS_SIMPLE, $CBS_DISABLENOSCROLL, $WS_VSCROLL))
GUISetState(@SW_SHOW)
; Fügt Dateien hinzu
_GUICtrlComboBox_BeginUpdate($idCombo)
_GUICtrlComboBox_AddDir($idCombo, @WindowsDir & "\*.exe")
_GUICtrlComboBox_EndUpdate($idCombo)
; Setzt den Top Index
_GUICtrlComboBox_SetTopIndex($idCombo, 10)
; Ermittelt den Top Index
MsgBox($MB_SYSTEMMODAL, "Information", "Top Index:" & @TAB & _GUICtrlComboBox_GetTopIndex($idCombo))
; Die Schleife wiederholt sich, bis der Benutzer die Beenden-Aktion der GUI auslöst.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>Example