找回密码
 加入
搜索
查看: 1107|回复: 4

关于GUI的问题

[复制链接]
发表于 2009-4-20 18:08:56 | 显示全部楼层 |阅读模式
本帖最后由 没有知道 于 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界面。
发表于 2009-4-20 20:52:03 | 显示全部楼层
#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 编辑 ]
发表于 2009-4-20 20:58:15 | 显示全部楼层
#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 编辑 ]
 楼主| 发表于 2009-4-22 15:51:38 | 显示全部楼层
就是这样,非常感谢
发表于 2009-4-23 00:02:16 | 显示全部楼层
恭喜解决,我想把第一页全刷成我的回复,帮顶一下了
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-28 14:59 , Processed in 0.069833 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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