找回密码
 加入
搜索
查看: 1195|回复: 3

如何检测用户按下了按钮?

[复制链接]
发表于 2009-6-30 13:27:24 | 显示全部楼层 |阅读模式
本帖最后由 faceyao 于 2009-6-30 14:25 编辑

比如按下了按钮1,如何才能检测到?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2009-6-30 13:41:20 | 显示全部楼层
想怎么样?是以文本的形式将此动作纪录下来,还是有个响应事件?请说清楚!
发表于 2009-6-30 14:12:09 | 显示全部楼层
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 227, 59, 192, 124)
$Button1 = GUICtrlCreateButton("确定", 16, 16, 75, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("取消", 112, 16, 75, 25, $WS_GROUP)
GUISetState(@SW_SHOW)


While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        MsgBox (0,"","你点击了【确定】按钮")
                Case $Button2        
                        MsgBox (0,"","你点击了【取消】按钮")
        EndSwitch
WEnd
 楼主| 发表于 2009-6-30 14:25:32 | 显示全部楼层
谢谢楼上,已解决
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-13 22:07 , Processed in 0.071026 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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