Function Reference


_GUICtrlListView_GetItemIndent

Retrieves the number of image widths the item is indented

#include <GuiListView.au3>
_GUICtrlListView_GetItemIndent ( $hWnd, $iIndex )

Parameters

$hWnd Control ID/Handle to the control
$iIndex 0-based item index

Return Value

Returns the item indention.

Related

_GUICtrlListView_SetItemIndent

Example

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

Example()

Func Example()
        GUICreate("ListView Get/Set Item Indent (v" & @AutoItVersion & ")", 400, 300)
        Local $idListview = GUICtrlCreateListView("", 2, 2, 394, 268)
        GUISetState(@SW_SHOW)

        ; Set ANSI format
;~     _GUICtrlListView_SetUnicodeFormat($idListview, False)

        ; Load images
        Local $hImage = _GUIImageList_Create()
        _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($idListview, 0xFF0000, 16, 16))
        _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($idListview, 0x00FF00, 16, 16))
        _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($idListview, 0x0000FF, 16, 16))
        _GUICtrlListView_SetImageList($idListview, $hImage, 1)

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

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

        ; Indent items
        _GUICtrlListView_SetItemIndent($idListview, 1, 1)
        _GUICtrlListView_SetItemIndent($idListview, 2, 2)
        MsgBox($MB_SYSTEMMODAL, "Information", "Item 1 Indent: " & _GUICtrlListView_GetItemIndent($idListview, 1))

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