Function Reference

_GUICtrlListView_GetItemCount

リストビューコントロール内のアイテムの数を取得します。

#Include <GuiListView.au3>
_GUICtrlListView_GetItemCount($hWnd)

 

パラメータ

$hWnd コントロールのハンドル

 

返し値

アイテムの数を返します。

 

注意

なし。

 

関連

_GUICtrlListView_SetItemCount

 


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

Opt('MustDeclareVars', 1)

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

_Main()

Func _Main()
    Local $hListView
   
    GUICreate("ListView Get Item Count", 400, 300)
    $hListView = GUICtrlCreateListView("col1|col2|col3", 2, 2, 394, 268)
    GUISetState()
   
    GUICtrlCreateListViewItem("line1|data1|more1", $hListView)
    GUICtrlCreateListViewItem("line2|data2|more2", $hListView)
    GUICtrlCreateListViewItem("line3|data3|more3", $hListView)
    GUICtrlCreateListViewItem("line4|data4|more4", $hListView)
    GUICtrlCreateListViewItem("line5|data5|more5", $hListView)

    MsgBox(4160, "Information", "Item Count: " & _GUICtrlListView_GetItemCount($hListView))

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

    GUIDelete()
EndFunc   ;==>_Main