# Function Reference

# _GUICtrlComboBoxEx_DeleteString

Removes an item from a ComboBoxEx control

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

## Parameters

$hWnd | Handle to the control
$iIndex | 0-based index of the Item to delete

## Return Value

Returns the number of items remaining in the control.

## Related

_GUICtrlComboBoxEx_AddString

## Example

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

    Example()

    Func Example()
        Local $hGUI, $hImage, $hCombo

        ; Create GUI
        $hGUI = GUICreate("ComboBoxEx Delete String", 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 : Random string", Random(1, 100, 1)), $x, $x)
        Next

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

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