Function Reference

_GUICtrlListView_SetItemIndent

アイテムをインデントする画像幅数を設定します。

#Include <GuiListView.au3>
_GUICtrlListView_SetItemIndent($hWnd, $iIndex, $iIndent)

 

パラメータ

$hWnd コントロールのハンドル
$iIndex アイテムのゼロ始まりのインデックス
$iIndent インデント値

 

返し値

成功: True
失敗: False

 

注意

なし。

 

関連

_GUICtrlListView_GetItemIndent

 


#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>

Opt('MustDeclareVars', 1)

$Debug_LV = False ; ListView関数に渡されるClassNameを調べる。動作を確認するにはTrueを設定し、他のコントロールのハンドルを使用

_Main()

Func _Main()
    Local $hImage, $hListView
   
    GUICreate("ListView Set Item Indent", 400, 300)
    $hListView = GUICtrlCreateListView("", 2, 2, 394, 268)
    GUISetState()

    ; 画像をロード
    $hImage = _GUIImageList_Create()
    _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0xFF0000, 16, 16))
    _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0x00FF00, 16, 16))
    _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0x0000FF, 16, 16))
    _GUICtrlListView_SetImageList($hListView, $hImage, 1)

    ; 列を追加
    _GUICtrlListView_AddColumn($hListView, "Items", 100)

    ; アイテムを追加
    _GUICtrlListView_AddItem($hListView, "Item 1", 0)
    _GUICtrlListView_AddItem($hListView, "Item 2", 1)
    _GUICtrlListView_AddItem($hListView, "Item 3", 2)

    ; アイテムをインデント
    _GUICtrlListView_SetItemIndent($hListView, 1, 1)
    _GUICtrlListView_SetItemIndent($hListView, 2, 2)
    MsgBox(4160, "Information", "Item 2 Indent: " & _GUICtrlListView_GetItemIndent($hListView, 1))

    ; ユーザーが終了するまでループ
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>_Main