找回密码
 加入
搜索
查看: 4621|回复: 9

[GUI管理] 【已解决】GUI 界面 如何从子窗口返回到主界面

  [复制链接]
发表于 2010-7-30 16:20:00 | 显示全部楼层 |阅读模式
本帖最后由 261869247 于 2010-7-30 16:53 编辑

大家帮忙看看这段代码 如何从子窗口返回到主界面
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 251, 95, -1, -1)
$Button1 = GUICtrlCreateButton("登陆", 72, 16, 97, 49)
GUISetState(@SW_SHOW)


While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        GUIDelete($Form1)
                        $Form1 = GUICreate("Form1", 251, 95, 222, 290)
                        $Button1 = GUICtrlCreateButton("返回登录界面", 72, 16, 97, 49)
                        GUISetState(@SW_SHOW)
                        While 1
                                $nMsg = GUIGetMsg()
                                Switch $nMsg
                                        Case $GUI_EVENT_CLOSE
                                                Exit
                                        Case $Button1
                    ; 这里写什么代码如何删除当前GUI 返回到主界面
                                EndSwitch
                        WEnd

        EndSwitch
WEnd

评分

参与人数 1金钱 +10 收起 理由
afan + 10 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

发表于 2010-7-30 16:22:30 | 显示全部楼层
回复 1# 261869247
善用搜索功能,http://www.autoitx.com/search.ph ... mp;searchsubmit=yes
 楼主| 发表于 2010-7-30 16:24:16 | 显示全部楼层
好的 我在看看
 楼主| 发表于 2010-7-30 16:27:34 | 显示全部楼层
看了下都没类似的!
发表于 2010-7-30 16:43:07 | 显示全部楼层
$Form1 = GUICreate('Form1', 251, 95)
$Button11 = GUICtrlCreateButton('登陆', 72, 16, 97, 49)
GUISetState()

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case -3
                        Exit
                Case $Button11
                        GUISetState(@SW_HIDE, $Form1)
                        $Form2 = GUICreate('Form2', 251, 95)
                        $Button21 = GUICtrlCreateButton('返回登录界面', 72, 16, 97, 49)
                        GUISetState()
                        While 1
                                $nMsg = GUIGetMsg()
                                Switch $nMsg
                                        Case -3
                                                Exit
                                        Case $Button21
                                                GUISetState(@SW_HIDE, $Form2)
                                                GUISetState(@SW_SHOW, $Form1)
                                                ExitLoop
                                EndSwitch
                        WEnd

        EndSwitch
WEnd
 楼主| 发表于 2010-7-30 16:53:02 | 显示全部楼层
哈哈 这代码精彩!
 楼主| 发表于 2010-7-30 16:53:31 | 显示全部楼层
真的 我每次发帖我都搜索了下 没有类似的才发的
发表于 2011-10-10 18:43:11 | 显示全部楼层
使用ExitLoop而不是Exit
发表于 2011-11-28 20:31:09 | 显示全部楼层
留个脚印,以备后用!
发表于 2012-1-2 10:45:14 | 显示全部楼层
五楼正解。。。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-6-1 09:58 , Processed in 0.112877 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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