找回密码
 加入
搜索
查看: 2095|回复: 2

[AU3基础] GUICtrlCreateCheckbox 在程序里如何使用?请高手帮助!【已完结】

[复制链接]
发表于 2011-10-23 12:29:20 | 显示全部楼层 |阅读模式
本帖最后由 mtvtop 于 2011-10-23 23:47 编辑

我点结束的时候能关闭该程序,但我点了开始运行程序后,再点结束就没有任何反应,请问问题出在哪?
还有一个问题是,我想在主程序里判断如果数值1打钩就运行相关的程序,这个要怎么写?
$shu1和$shu2怎么引用到主程序里?
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3> ;图形界面用的
#Region ### START Koda GUI section ###  ;koda开始,一种制作gui的东西,方便新手
$Form1 = GUICreate("自己", 1000,650) ;建立gui(1000X750);创建用户图形界面接口(GUI) 
$Button1 = GUICtrlCreateButton("开始", 40, 320, 80, 33)
$Button2 = GUICtrlCreateButton("结束", 280, 320, 80, 33)
$Checkbox1 = GUICtrlCreateCheckbox("数值1", 32, 192, 97, 17)
$Checkbox2 = GUICtrlCreateCheckbox("数值2", 32, 224, 97, 17)
GUISetState(@SW_SHOW);显示gui
#EndRegion ### END Koda GUI section ###;koda结束,一种制作gui的东西,方便新手

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
;开始主程序
While 1
;.......主程序
WEnd
;结束主程序
                Case $Button2
                        MsgBox(0,"说明","结束运行")
                        Exit
                Case $Checkbox1
                         $shu_a=1
                Case $Checkbox2
                         $shu_b=2
                        

        EndSwitch

WEnd
发表于 2011-10-23 17:57:23 | 显示全部楼层
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("自己", 1000, 650)
$Button1 = GUICtrlCreateButton("开始", 40, 320, 80, 33)
$Button2 = GUICtrlCreateButton("结束", 280, 320, 80, 33)
$Checkbox1 = GUICtrlCreateCheckbox("数值1", 32, 192, 97, 17)
$Checkbox2 = GUICtrlCreateCheckbox("数值2", 32, 224, 97, 17)
GUISetState(@SW_SHOW)
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then Run(@WindowsDir & "\Notepad.exe", "", @SW_MAXIMIZE)
                        If GUICtrlRead($Checkbox2) = $GUI_CHECKED Then ShellExecute("http://www.autoitx.com")
                Case $Button2
                        Exit
        E
如此?
 楼主| 发表于 2011-10-23 23:46:26 | 显示全部楼层
谢谢,就是要这个
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-20 22:46 , Processed in 0.098958 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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