回复 happytc
单独创建好像没见过特殊的限制,如果是数组创建的话,估计是数组的要求,这好像和listview关 ...
netegg 发表于 2011-10-4 14:11
有的,试了下面的代码,最多只能创建Items数是65530,而数组是1600万个元素。
显然,au3还是把Item当作控件了,因为au3最多只能在每个窗口中的GUI控件的最大数量: 65532
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Example()
Func Example()
Local $listview, $button, $item[1000000], $msg
GUICreate("listview items", 220, 250, 100, 200, -1, $WS_EX_ACCEPTFILES)
GUISetBkColor(0x00E0FFFF) ; will change background color
$listview = GUICtrlCreateListView("col1 |col2|col3 ", 10, 10, 200, 150);,$LVS_SORTDESCENDING)
$button = GUICtrlCreateButton("Value?", 75, 170, 70, 20)
For $i = 0 To UBound($item) - 1
$item[$i] = GUICtrlCreateListViewItem("item" & $i & "|col" & $i & "|col" & $i, $listview)
Next
GUICtrlCreateInput("", 20, 200, 150)
GUICtrlSetState(-1, $GUI_DROPACCEPTED) ; to allow drag and dropping
GUISetState()
;GUICtrlSetData($item2, "ITEM1")
;GUICtrlSetData($item3, "||COL33")
;GUICtrlDelete($item1)
Do
$msg = GUIGetMsg()
Select
Case $msg = $button
MsgBox(0, "listview item", GUICtrlRead(GUICtrlRead($listview)), 2)
Case $msg = $listview
MsgBox(0, "listview", "clicked=" & GUICtrlGetState($listview), 2)
EndSelect
Until $msg = $GUI_EVENT_CLOSE
EndFunc
|