Function Reference


_GUICtrlListView_SetItemText

Changes the text of an item or subitem

#include <GuiListView.au3>
_GUICtrlListView_SetItemText ( $hWnd, $iIndex, $sText [, $iSubItem = 0] )

Parameters

$hWnd Control ID/Handle to the control
$iIndex 0-based index of the item
$sText Item or subitem text
$iSubItem [optional] 1-based index of the subitem or 0 to set the item

Return Value

Success: True.
Failure: False.

Related

_GUICtrlListView_GetItemText, _GUICtrlListView_GetItemTextArray, _GUICtrlListView_GetItemTextString, _GUICtrlListView_InsertItem

Example

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

Example()

Func Example()
    Local $idListview

    GUICreate("ListView Set Item Text", 400, 300)
    $idListview = GUICtrlCreateListView("", 2, 2, 394, 268)
    GUISetState(@SW_SHOW)

    ; Add columns
    _GUICtrlListView_AddColumn($idListview, "Items", 100)

    ; Add items
    _GUICtrlListView_AddItem($idListview, "Item 1")
    _GUICtrlListView_AddItem($idListview, "Item 2")
    _GUICtrlListView_AddItem($idListview, "Item 3")

    ; Set item 2 text
    _GUICtrlListView_SetItemText($idListview, 1, "New Item 2")
    MsgBox($MB_SYSTEMMODAL, "Information", "Item 2 Text: " & _GUICtrlListView_GetItemText($idListview, 1))

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