找回密码
 加入
搜索
查看: 3371|回复: 7

怎么在消息循环中触发点击某个Label控件数组

  [复制链接]
发表于 2010-1-19 20:52:36 | 显示全部楼层 |阅读模式
本帖最后由 kob5891 于 2010-1-19 22:34 编辑

while 1
ctrlarray[X]=GUICtrlCreateLabel(......)
if ..... then exitloop
wend

X表示不固定整数
当点击某个Label控件时 怎么在消息循环中触发点击某个Label控件呢?
发表于 2010-1-19 21:51:19 | 显示全部楼层
再来个循环咯
 楼主| 发表于 2010-1-19 22:33:51 | 显示全部楼层
问题已解决  感谢Sxd


代码如下:
#NoTrayIcon
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
Dim $i,$Form1,$Label[11]

$Form1 = GUICreate("Form1", 233, 354, 193, 115)
GUISetOnEvent($GUI_EVENT_CLOSE, "ExitMe")
For $i=1 To 10
        $Label[$i] = GUICtrlCreateLabel("dddd" & $i, 10+$i*5, 20+$i*30)
        GUICtrlSetOnEvent($Label[$i], "lab")
Next

GUISetState(@SW_SHOW)

While 1
Sleep(1000)
WEnd

Func lab()
        MsgBox(0,0,GUICtrlRead(@GUI_CtrlId))
EndFunc

Func ExitMe()
        Exit
EndFunc
发表于 2010-1-19 22:59:17 | 显示全部楼层
呵呵,换事件模式了~~
发表于 2010-4-30 19:53:06 | 显示全部楼层
很好,学习了。
发表于 2010-9-11 09:40:45 | 显示全部楼层
很好,学习了。。。。。。。。。
发表于 2010-9-22 10:59:44 | 显示全部楼层
很好
问题已解决请写到标题中
发表于 2013-7-3 10:25:15 | 显示全部楼层
学习了 刚刚接触这块
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-29 01:23 , Processed in 0.082271 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表