找回密码
 加入
搜索
查看: 2386|回复: 4

[AU3基础] GUI使用

[复制链接]
发表于 2010-3-5 18:28:18 | 显示全部楼层 |阅读模式
一个程序有二个GUI。  GUI1 ,GUI2

GUI1一直运行。 GUI2点取消时退出,但GUI1继续运行。  请问如何做到。
发表于 2010-3-5 18:40:29 | 显示全部楼层
回复 1# tzz365
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 375, 242, 192, 124)
$Button1 = GUICtrlCreateButton("打开", 40, 96, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        form2()        
        EndSwitch
WEnd


Func form2()
$Form3 = GUICreate("窗体1", 413, 298, 197, 135)
GUISetState(@SW_SHOW)
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        GUIDelete($Form3)
                        ExitLoop
        EndSwitch
WEnd
EndFunc
 楼主| 发表于 2010-3-5 20:42:04 | 显示全部楼层
点确定,弹出确定和取消。  点取消关闭GUI2   点确定运行QQGAME
请问如何设置
Global $time = 30
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("test", 350, 172, 193, 125)
$gaway1 = GUICtrlCreateLabel("test", 107, 15, 120, 17)
GUICtrlSetFont(-1, 15, 400, 0, "楷体_GB2312")
$Label1 = GUICtrlCreateLabel("30秒后test!", 1, 50, 400, 28)
GUICtrlSetFont(-1, 12, 400, 0, "楷体_GB2312")
$Progress1 = GUICtrlCreateProgress(8, 88, 333, 17)
$Button1 = GUICtrlCreateButton("确定(&Y)", 53, 128, 73, 25, 0)
$Button2 = GUICtrlCreateButton("退出(&X)", 210, 128, 73, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
AdlibRegister("_timer", 1000)
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE, $Button2
                        Exit
                Case $Button1
                        ExitLoop
        EndSwitch
        If $time <= 0 Then ExitLoop
WEnd
main()
Exit

Func _timer()
        $time -= 1
        GUICtrlSetData($Label1, $time & "秒后test")
        GUICtrlSetData($Progress1, (30 - $time) / 0.3)
        If $time <= 0 Then AdlibUnRegister()
EndFunc   ;==>_timer

Func main()
Run("D:\Program Files\腾讯游戏\QQGAME\QQGame.exe");qq
EndFunc   ;==>main
发表于 2010-3-5 21:15:40 | 显示全部楼层
这样的代码我都懒得写了。 你就不会用下论坛的搜索吗???

那么多双窗口的例子你不找。非要开个新帖占论坛空间。。  无奈死了。

http://autoitx.com/forum.php?mod ... mp;page=1#pid137835
 楼主| 发表于 2010-3-6 10:09:31 | 显示全部楼层
回复 4# lanfengc


    高手能不能帮小弟改编下。。  我做了好久都不行。。。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-20 12:48 , Processed in 0.082202 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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