Funktionreferenz


_GUICtrlComboBoxEx_DeleteString

Beschreibung anzeigen in

Löscht ein Item von einem ComboBoxEx Control

#include <GuiComboBoxEx.au3>
_GUICtrlComboBoxEx_DeleteString ( $hWnd, $iIndex )

Parameter

$hWnd Control-ID / Handle des Controls
$iIndex 0-basierender Index des zu löschenden Items

Rückgabewert

Gibt die Anzahl von Items die in dem Control bleiben zurück.

Bemerkungen

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

Verwandte Funktionen

_GUICtrlComboBoxEx_AddString

Beispiel

#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: String löschen", 400, 300)
    $hCombo = _GUICtrlComboBoxEx_Create($hGui, "", 2, 2, 394, 100, $CBS_SIMPLE)
    GUISetState(@SW_SHOW)

    $hImage = _GUIImageList_Create(16, 16, 5, 3)
    _GUIImageList_Add($hImage, _GUICtrlComboBoxEx_CreateSolidBitMap($hCombo, 0xFF0000, 16, 16))
    _GUIImageList_Add($hImage, _GUICtrlComboBoxEx_CreateSolidBitMap($hCombo, 0x00FF00, 16, 16))
    _GUIImageList_Add($hImage, _GUICtrlComboBoxEx_CreateSolidBitMap($hCombo, 0x0000FF, 16, 16))
    _GUICtrlComboBoxEx_SetImageList($hCombo, $hImage)

    For $x = 0 To 2
        _GUICtrlComboBoxEx_AddString($hCombo, StringFormat("%03d : Zufallstring", Random(1, 100, 1)), $x, $x)
    Next

    ; Delete String
    MsgBox($MB_SYSTEMMODAL, "Information", "String löschen")
    _GUICtrlComboBoxEx_DeleteString($hCombo, 1)

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