Delete a string
#include <GuiListBox.au3>
_GUICtrlListBox_DeleteString ( $hWnd, $iIndex )
$hWnd | Control ID/Handle to the control |
$iIndex | 0-based index of the string to be deleted |
Success: | the count of strings remaining. |
Failure: | -1. |
_GUICtrlListBox_AddFile, _GUICtrlListBox_AddString, _GUICtrlListBox_InsertString, _GUICtrlListBox_ResetContent
#include <GUIConstantsEx.au3>
#include <GuiListBox.au3>
Example()
Func Example()
Local $idListBox
; Create GUI
GUICreate("List Box Delete String", 400, 296)
$idListBox = GUICtrlCreateList("", 2, 2, 396, 296)
GUISetState(@SW_SHOW)
; Add strings
_GUICtrlListBox_BeginUpdate($idListBox)
For $iI = 1 To 9
_GUICtrlListBox_AddString($idListBox, StringFormat("%d : List box string", $iI))
Next
_GUICtrlListBox_EndUpdate($idListBox)
; Delete middle string
_GUICtrlListBox_DeleteString($idListBox, 4)
; Loop until the user exits.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>Example