#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
$Debug_LV = False ; 检查传递给 ListView 函数的类名, 设置为真并使用另一控件的句柄可以看出它是否有效
_Main()
Func _Main()
Local $iI, $iTimer, $hListView
; 创建 GUI
GUICreate("ListView Add Array", 400, 300)
$hListView = GUICtrlCreateListView("", 2, 2, 394, 268)
GUISetState()
; 添加列
Local $item[100], $i
For $i = 0 To 99 Step 1
_GUICtrlListView_AddColumn($hListView, $i, 100)
Next
_GUICtrlListView_SetItemCount($hListView, 1000)
; 加载100列
Dim $J = 0, $aItems[200][100]
For $iI = 0 To UBound($aItems) - 1
For $J = 0 To 99
$aItems[$iI][$J] = "Item " & $iI & "-" & $J
Next
Next
$iTimer = TimerInit()
_GUICtrlListView_AddArray($hListView, $aItems)
MsgBox(4160, "信息", "Load time: " & TimerDiff($iTimer) / 1000 & " seconds")
; 循环直到用户退出
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>_Main
|