找回密码
 加入
搜索
查看: 1145|回复: 1

这样写为什么出错?

[复制链接]
发表于 2009-6-26 16:10:10 | 显示全部楼层 |阅读模式
如下这样,出错为什么
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("父窗口", 381, 205, 192, 124)
$Button1 = GUICtrlCreateButton("Button1", 128, 56, 105, 65, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg(1)
        Select
                Case $nMsg(0)=$Button1
                        $Form2 = GUICreate("子窗口", 381, 205, 192, 124)
                        $Button2 = GUICtrlCreateButton("Button2", 128, 56, 105, 65, $WS_GROUP)
                        GUISetState(@SW_SHOW)
                Case $nMsg(0)=$GUI_EVENT_CLOSE
                        If $nMsg(1)=$Form2 Then
                                GUIDelete()
                        ElseIf $nMsg(1)=$Form1 Then
                                GUIDelete()
                                Exit
                        EndIf
        EndSelect
WEnd
发表于 2009-6-26 16:45:54 | 显示全部楼层
While 1
        $nMsg = GUIGetMsg()
        Select
                Case $Button1
                        $Form2 = GUICreate("子窗口", 381, 205, 192, 124)
                        $Button2 = GUICtrlCreateButton("Button2", 128, 56, 105, 65, $WS_GROUP)
                        GUISetState(@SW_SHOW)
                Case $GUI_EVENT_CLOSE
                        If $nMsg(1)=$Form2 Then
                                GUIDelete()
                        ElseIf $nMsg(1)=$Form1 Then
                                GUIDelete()
                                Exit
                        EndIf
        EndSelect
WEnd
虽解决了报错的问题,但此为一个死循环,不知楼主到底要做什么?
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-23 01:39 , Processed in 0.074146 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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