关闭子窗体父窗体不关闭
本帖最后由 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
回复 1# asdmie01
坛子有一大堆老代码了,楼主搜索一下吧~~
PS:case $button5 的提示MS有点~~ 看帮助去,示例里有现成的 http://www.autoitx.com/forum.php?mod=viewthread&tid=33735&highlight=%D7%D3%B4%B0这里有啊
页:
[1]