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

[AU3基础] 关闭子窗体父窗体不关闭

[复制链接]
发表于 2012-11-28 17:14:41 | 显示全部楼层 |阅读模式
本帖最后由 asdmie01 于 2012-11-28 18:46 编辑

如果实现当子窗体关闭的时候父窗体不关闭。
#include <GUIConstants.au3>
$WinMain  = GUICreate("主窗口", 450, 300)
$Button1  = GUICtrlCreateButton("显示子窗口 1", 0, 0, 113, 49)
$Button2 = GUICtrlCreateButton("显示子窗口 2", 216, 0, 105, 49)
$WinSub1  = GUICreate("子窗口", 220, 60)   
$Button3 = GUICtrlCreateButton("确认", 0, 0, 100, 50)
$Button4 = GUICtrlCreateButton("取消", 110, 0, 100, 50)
$WinSub2  = GUICreate("子窗口", 220, 60)  
$Button5 = GUICtrlCreateButton("确认", 0, 0, 100, 50)
$Button6 = GUICtrlCreateButton("取消", 110, 0, 100, 50)
GUISwitch($WinMain)
GUISetState(@SW_SHOW)  
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                        Case $Button1
                        GUISetState(@SW_SHOW,$WinSub1);  显示 子窗口 1
                Case $Button2
                        GUISetState(@SW_SHOW,$WinSub2);  显示 子窗口 2
                Case $Button3
                        MsgBox(48,0,"你点了子窗口 1 中的第一个按钮")
                Case $Button4
                        GUISetState(@SW_HIDE,$WinSub1);  隐藏 子窗口 1
                Case $Button5
                        MsgBox(48,0,"你点了主窗口 2 中的第一个按钮")
                Case $Button6
                        GUISetState(@SW_HIDE,$WinSub2);  隐藏 子窗口 2
        EndSwitch
WEnd
发表于 2012-11-28 17:29:54 | 显示全部楼层
回复 1# asdmie01


    坛子有一大堆老代码了,楼主搜索一下吧~~
PS:case $button5 的提示MS有点~~
发表于 2012-11-28 17:32:14 | 显示全部楼层
看帮助去,示例里有现成的
发表于 2013-1-5 14:16:04 | 显示全部楼层
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-29 13:31 , Processed in 0.152226 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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