Funktionreferenz


_GUICtrlComboBoxEx_InsertString

Beschreibung anzeigen in

Fügt ein neues Item in das Control ein

#include <GuiComboBoxEx.au3>
_GUICtrlComboBoxEx_InsertString ( $hWnd, $sText [, $iIndex = -1 [, $iImage = -1 [, $iSelectedImage = -1 [, $iOverlayImage = -1 [, $iIndent = -1 [, $iParam = -1]]]]]] )

Parameter

$hWnd Handle des Controls
$sText Itemtext. Falls auf -1 gesetzt, wird das Item durch die $CBEN_GETDISPINFO Nachricht gesetzt.
$iIndex [optional] 0-basierender Index wo der neue String eingefügt werden soll.
Um einen String an das Ende der Liste einzufügen, ist $iIndex auf -1 zu setzen
$iImage [optional] 0-basierender Index des Icons des Items in der Imagelist des Controls
$iSelectedImage [optional] 0-basierender Index des Icons des Items in der Imagelist des Controls
$iOverlayImage [optional] 0-basierender Index des Icons des Items in der Imagelist des Controls
$iIndent [optional] Anzahl von Bilderbreiten um die das Item eingerückt werden soll. Eine einfache Einrückung entspricht eine Breite eines Bildes.
$iParam [optional] Wert der das Item festlegt

Rückgabewert

Erfolg: Der Index des neuen Items
Fehler: -1

Bemerkungen

- - - - - - - - Erklärung der Controls - - - - - - - -

Verwandte Funktionen

_GUICtrlComboBoxEx_InitStorage

Beispiel

#include <GuiComboBoxEx.au3>
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>

Example()

Func Example()
    ; Erstellt eine GUI
    Local $hGUI = GUICreate("ComboBoxEx: String einfügen (v" & @AutoItVersion & ")", 400, 300)
    Local $hCombo = _GUICtrlComboBoxEx_Create($hGUI, "", 2, 2, 394, 100)
    GUISetState(@SW_SHOW)

    ; Fügt Dateien hinzu
    _GUICtrlComboBoxEx_BeginUpdate($hCombo)
    _GUICtrlComboBoxEx_AddDir($hCombo, "", $DDL_DRIVES, False)
    _GUICtrlComboBoxEx_AddDir($hCombo, "", $DDL_DRIVES)
    _GUICtrlComboBoxEx_BeginUpdate($hCombo)
    _GUICtrlComboBoxEx_AddDir($hCombo, @WindowsDir & "\*.exe")
    _GUICtrlComboBoxEx_EndUpdate($hCombo)
    _GUICtrlComboBoxEx_EndUpdate($hCombo)

    ; Einen String einfügen
    _GUICtrlComboBoxEx_InsertString($hCombo, "eingefügter Text", 1)

    ; Zeigt das Dropdown
    _GUICtrlComboBoxEx_ShowDropDown($hCombo, True)

    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>Example