Ermittelt den 0-basierenden Index des ersten sichtbaren Items in dem ListBox Abschnitt einer ComboBox
#Include <GuiComboBoxEx.au3>
_GUICtrlComboBoxEx_GetTopIndex($hWnd)
Parameter
| $hWnd | Handle des Controls |
Rückgabewert
Erfolg: Der Index des ersten sichtbaren Items in der ListBox der ComboBox
Bemerkungen
- - - - - - - - Erklärung der Controls - - - - - - - -
Verwandte Funktionen
_GUICtrlComboBoxEx_SetTopIndex
Beispiel
#include <GuiComboBoxEx.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 $hGUI, $hCombo
; Erstellt eine GUI
$hGUI = GUICreate("ComboBoxEx: Ermittelt das erste sichtbare Item", 600, 300)
$hCombo = _GUICtrlComboBoxEx_Create($hGUI, "", 2, 2, 394, 100, $CBS_SIMPLE)
GUISetState()
_GUICtrlComboBoxEx_InitStorage($hCombo, 150, 300)
_GUICtrlComboBoxEx_BeginUpdate($hCombo)
For $x = 0 To 149
_GUICtrlComboBoxEx_AddString($hCombo, StringFormat("%03d : Zufallstring", Random(1, 100, 1)))
Next
_GUICtrlComboBoxEx_EndUpdate($hCombo)
; Ermittelt das erste sichtbare Item
MsgBox(4160, "Information", "Stellt sicher, dass ein bestimmtes Item sichtbar ist: " & _GUICtrlComboBoxEx_SetTopIndex($hCombo, Random(50, 149, 1)))
MsgBox(4160, "Information", "Ermittelt das erste sichtbare Item: " & _GUICtrlComboBoxEx_GetTopIndex($hCombo))
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc ;==>_Main