faceyao 发表于 2009-6-30 13:27:24

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

本帖最后由 faceyao 于 2009-6-30 14:25 编辑

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

hhasee 发表于 2009-6-30 13:41:20

想怎么样?是以文本的形式将此动作纪录下来,还是有个响应事件?请说清楚!

KLU3K 发表于 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

faceyao 发表于 2009-6-30 14:25:32

谢谢楼上,已解决
页: [1]
查看完整版本: 如何检测用户按下了按钮?