找回密码
 加入
搜索
查看: 1704|回复: 5

用GUI做“关于”,结果有点问题

[复制链接]
发表于 2008-10-27 18:53:54 | 显示全部楼层 |阅读模式
我用guidelete虽然能删除窗体,但是我单击父窗口上的任何按钮都没有反映,等于是循环依然生效

[ 本帖最后由 78391493 于 2008-10-27 20:44 编辑 ]
发表于 2008-10-27 20:02:14 | 显示全部楼层
说明白点,看不懂什么意思
发表于 2008-10-27 20:37:23 | 显示全部楼层
用ExitLoop退出循环
 楼主| 发表于 2008-10-27 20:41:14 | 显示全部楼层

回复 2# netegg 的帖子

自己试试看,打开过关于以后点退出就没反应了

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 170, 42, -1, -1)
$Button1 = GUICtrlCreateButton("关于", 8, 8, 75, 25, 0)
$Button2 = GUICtrlCreateButton("退出", 88, 8, 73, 25, 0)
GUISetState(@SW_SHOW)
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button2
                        Exit
                Case $Button1
                        $Form2 = GUICreate("关于", 222, 129, -1, -1, "", "", $Form1)
                        $Exit = GUICtrlCreateButton("关闭", 72, 40, 75, 25, 0)
                        GUISetState(@SW_SHOW)
                        While 1
                                $nMsg = GUIGetMsg()
                                Switch $nMsg
                                        Case $GUI_EVENT_CLOSE
                                                GUIDelete($Form2)
                                        Case $Exit
                                                GUIDelete($Form2)
                                EndSwitch
                        WEnd
        EndSwitch
WEnd
 楼主| 发表于 2008-10-27 20:42:47 | 显示全部楼层

回复 3# 大绯狼 的帖子

感谢,果然是循环搞的鬼
发表于 2008-10-27 22:50:07 | 显示全部楼层
真的,试运行了,点了关于后就关不了窗口了,但是加上EXITLOOP就OK了,我也是新手哈~~学习了
                                Switch $nMsg
                                        Case $GUI_EVENT_CLOSE
                                                GUIDelete($Form2)
                                                ExitLoop
                                        Case $Exit
                                                GUIDelete($Form2)
                                                ExitLoop
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-2 16:37 , Processed in 0.071392 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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