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

这个Case是怎么回事呢?

[复制链接]
发表于 2009-6-18 21:07:23 | 显示全部楼层 |阅读模式
本帖最后由 hearton 于 2009-6-22 20:21 编辑
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $Form1, $Button1, $Button2, $Button3, $Button4
$Form1 = GUICreate("Form1", 300, 300, 192, 124)
$Button1 = GUICtrlCreateButton("tiaozhuan2", 80, 64, 121, 33, 0)
$Button2 = GUICtrlCreateButton("tiaozhuan3", 80, 124, 121, 33, 0)
$Button3 = GUICtrlCreateButton("tiaozhuan3", 80, 184, 121, 33, 0)
GUISetState(@SW_SHOW)
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        tiaozhuan2();按下tiaozhuang2按钮时,执行tiaozhuan2()
                Case $Button2
                        tiaozhuan3()
                Case $Button3
                        $Button4 = GUICtrlCreateButton("tiaozhuan4", 80, 244, 121, 33, 0)
                Case $Button4
                        MsgBox(64 + 8192, "Sorry", "功能开发中...")
        EndSwitch
WEnd
Func tiaozhuan1()
        MsgBox(0, "", "11111111111")
EndFunc   ;==>tiaozhuan1
Func tiaozhuan2()
        MsgBox(0, "", "222222222222")
EndFunc   ;==>tiaozhuan2
Func tiaozhuan3()
        MsgBox(0, "", "33333333333333")
EndFunc   ;==>tiaozhuan3
为什么这个AU3一运行就弹出“功能开发中...”
也就是一运行就执行了Case $Button4 呢??????
发表于 2009-6-18 21:41:26 | 显示全部楼层
Global $Form1, $Button1, $Button2, $Button3, $Button4
把这段去掉。。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-12 10:49 , Processed in 0.069699 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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