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

[AU3基础] 請教 按下鍵盤Enter = 對控件做點擊 該如何?

  [复制链接]
发表于 2012-1-27 15:45:52 | 显示全部楼层 |阅读模式
請教 按下鍵盤Enter  =  對控件做點擊 該如何?

按下鍵盤Enter
=執行底下命令 該如何寫
ControlClick ( "EDIT","","Button1")
发表于 2012-1-27 17:23:49 | 显示全部楼层
回复 1# tcpuuu

要的是这个吗?
GUICtrlCreateButton("",10,20,10,20,$BS_DEFPUSHBUTTON )
 楼主| 发表于 2012-1-27 19:24:24 | 显示全部楼层
回复  tcpuuu

要的是这个吗?
showshow 发表于 2012-1-27 17:23

    不是
ControlClick ( "EDIT","","Button1")
這是對edit 窗口 的 Button1 做滑鼠點擊

設熱鍵 enter =     對edit 窗口 的 Button1 做滑鼠點擊
seed ({enter},ControlClick ( "EDIT","","Button1"))
发表于 2012-1-27 19:38:08 | 显示全部楼层
回复 3# tcpuuu

不懂你什么意思?
 楼主| 发表于 2012-1-27 22:02:06 | 显示全部楼层
本來要移動滑鼠去點擊Button1
改成  按下鍵盤Enter鍵   就可以去 點擊Button1
发表于 2012-1-28 10:31:15 | 显示全部楼层
先获取按钮焦点,再ENTER哈。。
发表于 2012-6-15 12:54:50 | 显示全部楼层
回复 1# tcpuuu


    请使用 HotKeySet
帮助中有详细介绍
发表于 2012-6-15 13:20:24 | 显示全部楼层
GUICreate('')
GUICtrlCreateEdit('', 5, 5, 390, 280)
$But1 = GUICtrlCreateButton('Button1', 200, 300, 100, 20)
GUISetState()
Dim $AccelKeys[1][2] = [["{Enter}", $But1]]
GUISetAccelerators($AccelKeys)

While 1
        Switch GUIGetMsg()
                Case -3
                        Exit
                Case $But1
                        MsgBox(0, 'ok', '按钮1动作')
                        ;ControlClick('EDIT', '', 'Button1')
        EndSwitch
WEnd
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-20 14:39 , Processed in 0.085293 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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