找回密码
 加入
搜索
查看: 2219|回复: 6

点一下开始点一下停止的按钮怎么制作的?

[复制链接]
发表于 2008-8-24 13:16:09 | 显示全部楼层 |阅读模式
不知道我的提问是否清楚,我想应该是可以表达这个意思了吧?

[ 本帖最后由 macemo 于 2008-8-25 08:56 编辑 ]
发表于 2008-8-24 13:38:35 | 显示全部楼层
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$jhwl = GUICreate("test", 262, 80, 193, 115)
$Button1 = GUICtrlCreateButton("开始", 32, 32, 75, 25, 0)
$Button2 = GUICtrlCreateButton("停止", 128, 32, 75, 25, 0)
GUICtrlSetState($Button2, $GUI_DISABLE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
        Case $Button1
                GUICtrlSetState($Button1, $GUI_DISABLE)        
                GUICtrlSetState($Button2, $GUI_ENABLE)
        Case $Button2
                GUICtrlSetState($Button2, $GUI_DISABLE)        
                GUICtrlSetState($Button1, $GUI_ENABLE)
        EndSwitch
WEnd

这样的吧?

本帖子中包含更多资源

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

×
 楼主| 发表于 2008-8-24 13:51:48 | 显示全部楼层
是一个按钮,点击变停止,再点击变开始
发表于 2008-8-24 15:32:07 | 显示全部楼层
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 284, 160, 193, 125)
$Button1 = GUICtrlCreateButton("开始", 64, 64, 145, 49, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                case $Button1
                        If GUICtrlRead($Button1)="开始" Then
                                GUICtrlSetData($Button1,"停止")
                        Else
                                GUICtrlSetData($Button1,"开始")
                        EndIf
        EndSwitch
WEnd
 楼主| 发表于 2008-8-25 08:55:48 | 显示全部楼层
感谢楼上两位的热心解答!
发表于 2012-1-7 10:39:16 | 显示全部楼层
是我找的那个,谢谢!
发表于 2012-1-7 16:27:28 | 显示全部楼层
哈哈,找到了一个实例谢谢。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-23 05:15 , Processed in 0.084011 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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