local $Button
$Button = GUICtrlCreateButton("模块1", 10, 464, 80, 41)
$Button = GUICtrlCreateButton("模块2", 110, 464, 80, 41)
$Button = GUICtrlCreateButton("模块3", 210, 464, 80, 41)
$Button = GUICtrlCreateButton("模块4", 310, 464, 80, 41)
$Button = GUICtrlCreateButton("模块5", 410, 464, 80, 41)
$Button = GUICtrlCreateButton("模块6", 510, 464, 80, 41)
数组是这样搞吗?挺麻烦的 回复 17# blue_dvd
是的。
那就用直接的
GUICtrlSetOnEvent($Button2, "_Every_month_Record") 本帖最后由 blue_dvd 于 2016-12-13 11:45 编辑
回复 18# chzj589
直接用
GUICtrlSetOnEvent(按钮, "函数名")
但是按钮多的话是不是
For $i=1 to6
GUICtrlSetOnEvent(Eval("Button"&String($i)), "_Main")
Next会更好? 回复chzj589
直接用但是按钮多的话是不是会更好?
blue_dvd 发表于 2016-12-13 11:34 http://www.autoitx.com/images/common/back.gif
按钮多可以用数组
Global $Button
$Form1_1 = GUICreate("测试系统", 800, 600, -1, -1)
$Button = GUICtrlCreateButton("模块1", 10, 464, 80, 41)
$Button = GUICtrlCreateButton("模块2", 110, 464, 80, 41)
$Button = GUICtrlCreateButton("模块3", 210, 464, 80, 41)
$Button = GUICtrlCreateButton("模块4", 310, 464, 80, 41)
$Button = GUICtrlCreateButton("模块5", 410, 464, 80, 41)
$Button = GUICtrlCreateButton("模块6", 510, 464, 80, 41)
GUISetState(@SW_SHOW)
For $i = 1 To 6
GUICtrlSetOnEvent($Button[$i], "_Main")
Next
回复 20# chzj589
这个知道,多谢了!
页:
1
[2]