hearton 发表于 2009-6-18 21:07:23

这个Case是怎么回事呢?

本帖最后由 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 呢??????

landays 发表于 2009-6-18 21:41:26

Global $Form1, $Button1, $Button2, $Button3, $Button4
把这段去掉。。
页: [1]
查看完整版本: 这个Case是怎么回事呢?