Function Reference


_GUICtrlListBox_DeleteString

Delete a string

 #include <GuiListBox.au3>
_GUICtrlListBox_DeleteString ( $hWnd, $iIndex )

Parameters

$hWnd Control ID/Handle to the control
$iIndex 0-based index of the string to be deleted

Return Value

Success: the count of strings remaining.
Failure: -1.

Remarks

None.

Related

_GUICtrlListBox_AddString, _GUICtrlListBox_InsertString, _GUICtrlListBox_AddFile, _GUICtrlListBox_ResetContent

Example

#include <GuiListBox.au3>
#include <GUIConstantsEx.au3>

Example()

Func Example()
    Local $hListBox

    ; Create GUI
    GUICreate("List Box Delete String", 400, 296)
    $hListBox = GUICtrlCreateList("", 2, 2, 396, 296)

    GUISetState(@SW_SHOW)

    ; Add strings
    _GUICtrlListBox_BeginUpdate($hListBox)
    For $iI = 1 To 9
        _GUICtrlListBox_AddString($hListBox, StringFormat("%d : List box string", $iI))
    Next
    _GUICtrlListBox_EndUpdate($hListBox)

    ; Delete middle string
    _GUICtrlListBox_DeleteString($hListBox, 4)

    ; Loop until the user exits.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>Example