本帖最后由 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
|