jenney.qiu

导航

子窗口与主窗口分开处理

#include <GUIConstantsEx.au3>
 
$mainwindow = GUICreate("Hello World", 300, 200)
GUICtrlCreateLabel("Hello world!", 30, 10)
$okbutton = GUICtrlCreateButton("opened the subform", 20, 30, 150)
 
主窗口点击按钮后又创建了一个新的子窗口,在关闭子窗口时主窗口也关闭了
$dummywindow
= GUICreate("Dummy window for testing ", 200, 100) GUISwitch($mainwindow) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg(1) Select Case $msg[0] = $okbutton GUISetState(@SW_SHOW,$dummywindow) Case $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $mainwindow Exit Case $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $dummywindow GUISetState(@SW_HIDE,$dummywindow) EndSelect WEnd

 

posted on 2015-09-29 10:12  jenney.qiu  阅读(389)  评论(0编辑  收藏  举报