关于GUI的问题
本帖最后由 没有知道 于 2009-4-22 15:52 编辑#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 633, 451, 192, 124)
$Button1 = GUICtrlCreateButton("Button1", 48, 40, 81, 41, 0)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$Form1 = GUICreate("Form1", 397, 253, 192, 124)
$Button1 = GUICtrlCreateButton("Button1", 48, 40, 81, 41, 0)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
EndSwitch
WEnd
怎么写才能关闭第二个GUI界面而不推出第一个GUI界面。 #include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 633, 451, 192, 124)
$Button1 = GUICtrlCreateButton("进入Form", 48, 40, 81, 41, 0)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
GUI()
EndSwitch
WEnd
Func GUI()
GUISetState(@SW_HIDE,$Form1)
$Form = GUICreate("Form", 397, 253, 192, 124)
$Button2 = GUICtrlCreateButton("返回Form1", 48, 40, 81, 41, 0)
GUISetState(@SW_SHOW)
While 1
$MsgForm = GUIGetMsg()
Select
Case $MsgForm = $gui_event_close Or $MsgForm = $Button2
GUIDelete($Form)
GUISetState(@SW_SHOW,$Form1)
GUISetState(@SW_ENABLE,$Form1 )
ExitLoop
EndSelect
WEnd
EndFunc
是这样吗?
[ 本帖最后由 lxz 于 2009-4-21 06:49 编辑 ] #include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 633, 451, 192, 124)
$Button1 = GUICtrlCreateButton("进入Form", 48, 40, 81, 41, 0)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
GUI()
EndSwitch
WEnd
Func GUI()
;GUISetState(@SW_HIDE,$Form1)
$Form = GUICreate("Form", 397, 253, 292, 224)
$Button2 = GUICtrlCreateButton("关闭", 48, 40, 81, 41, 0)
GUISetState(@SW_SHOW)
While 1
$MsgForm = GUIGetMsg()
Select
Case $MsgForm = $gui_event_close Or $MsgForm = $Button2
GUIDelete($Form)
;GUISetState(@SW_SHOW,$Form1)
;GUISetState(@SW_ENABLE,$Form1 )
ExitLoop
EndSelect
WEnd
EndFunc
还是这样?
[ 本帖最后由 lxz 于 2009-4-21 06:49 编辑 ] 就是这样,非常感谢 恭喜解决,我想把第一页全刷成我的回复,帮顶一下了
页:
[1]