试试我这段代码吧。。控件到9972就不动了。。然后我加了一个小循环,删除控件标识符大于9970的,然后msgbox有反应了#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
Opt("GUIOnEventMode", 1)
;调整这两个参数,大到一定程度,msgbox就没响应了
Local $w = 100;
Local $h = 100;
;调整这两个参数,大到一定程度,msgbox就没响应了
$Form1 = GUICreate("Form1", 500, 500)
GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")
Global $lable[$w+1][$h+1]
GUISetState(@SW_SHOW)
For $i = 1 To $w
For $j = 1 To $h
$lable[$i][$j] = GUICtrlCreateLabel('',$i-1,$j-1,1,1)
GUICtrlSetBkColor(-1,0xff00cc)
GUICtrlSetOnEvent($lable[$i][$j] ,'test')
ConsoleWrite("控件标识符 " & $lable[$i][$j] & "$i " & $i & "$j " & $j & @CRLF)
Next
Next
For $z = 9970 To 10000;删几个
If GUICtrlDelete ( $z ) = 1 Then ConsoleWrite("删除了 标识符为 " & $z & "的控件" & @CRLF)
Next
While 1
Sleep(10)
WEnd
Func test()
Local $i,$j
For $i = 1 To $w
For $j = 1 To $h
If @GUI_CtrlId = $lable[$i][$j] Then
ExitLoop(2)
EndIf
Next
Next
ConsoleWrite($i&'-'&$j);本行有响应
MsgBox(0,$i,$j );有反应了吧
ConsoleWrite(@LF);本行有响应
EndFunc
Func SpecialEvents()
Select
Case @GUI_CtrlId = $GUI_EVENT_CLOSE
Exit
EndSelect
EndFunc ;==>SpecialEvents
|