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

[GUI管理] GUI 中的button 除了ControlClick 还有什么办法可以产生点击一次的效果【已解决】

[复制链接]
发表于 2017-2-19 04:15:53 | 显示全部楼层 |阅读模式
本帖最后由 fenhanxue 于 2017-2-24 20:33 编辑

就是想看到这个按钮产生了被点击的视觉效果,除了
ControlClick($Form1,'',$Button1)
有没更高效的写法?
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 255, 151, 192, 114)
$Button1 = GUICtrlCreateButton("Button1", 32, 32, 185, 57)



GUISetState(@SW_SHOW)
Sleep(2000)
ControlClick($Form1,'',$Button1)

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd
发表于 2017-2-19 10:50:19 | 显示全部楼层
没看明白 直接 show gui后直接打命令不就行了?
GUISetState(@SW_SHOW)
Sleep(2000)
按钮1的代码()

Func 按钮1的代码()
发表于 2017-2-19 11:36:22 | 显示全部楼层
$Button1 = GUICtrlCreateButton("Button1", 32, 32, 185, 57,0x0001)
利用焦点,回车点击
发表于 2017-2-19 23:13:50 | 显示全部楼层
_SendMessage
GUICtrlSendMsg
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-25 04:56 , Processed in 0.076002 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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