lengfeng57 发表于 2010-12-26 07:17:52

新手学GUI,帮忙看看哪里不对!

#Region AutoIt3Wrapper 预编译参数(常用参数)
#AutoIt3Wrapper_Icon=                                                                                 ;图标,支持EXE,DLL,ICO
#AutoIt3Wrapper_OutFile=                                                                        ;输出文件名
#AutoIt3Wrapper_OutFile_Type=exe                                                        ;文件类型
#AutoIt3Wrapper_Compression=4                                                                ;压缩等级
#AutoIt3Wrapper_UseUpx=y                                                                         ;使用压缩
#AutoIt3Wrapper_Res_Comment=                                                                 ;注释
#AutoIt3Wrapper_Res_Description=                                                        ;详细信息
#AutoIt3Wrapper_Res_Fileversion=                                                        ;文件版本
#AutoIt3Wrapper_Res_FileVersion_AutoIncrement=p                                ;自动更新版本
#AutoIt3Wrapper_Res_LegalCopyright=                                                 ;版权
#AutoIt3Wrapper_Change2CUI=N                                                   ;修改输出的程序为CUI(控制台程序)
;#AutoIt3Wrapper_Res_Field=AutoIt Version|%AutoItVer%                ;自定义资源段
;#AutoIt3Wrapper_Run_Tidy=                                                   ;脚本整理
;#AutoIt3Wrapper_Run_Obfuscator=                                                      ;代码迷惑
;#AutoIt3Wrapper_Run_AU3Check=                                                                 ;语法检查
;#AutoIt3Wrapper_Run_Before=                                                                 ;运行前
;#AutoIt3Wrapper_Run_After=                                                                        ;运行后
#EndRegion AutoIt3Wrapper 预编译参数设置完成
#cs ____________________________________

Au3 版本:
脚本作者: 破布
        Email: zdx_520@163.com
        QQ/TM: 200860312
脚本版本:
脚本功能:

#ce _______________脚本开始_________________

MsgBox(0, "名仕网吧", "名仕网吧传奇私服群:84473853")
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=F:\Xu\AU3\私服登录器目录\Form1.kxf
$Form1 = GUICreate("名仕网吧欢迎您", 414, 263, 192, 114)
$Button1 = GUICtrlCreateButton("盛大传奇私服", 48, 40, 137, 49)
$Button2 = GUICtrlCreateButton("传奇世界私服", 224, 40, 137, 49)
$Button3 = GUICtrlCreateButton("劲舞团私服", 48, 128, 137, 49)
$Button4 = GUICtrlCreateButton("完美世界私服", 224, 128, 137, 49)
$Label1 = GUICtrlCreateLabel("请选择您要玩的私服,点击后再将登录器放入弹出文件夹内即可", 32, 216, 340, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $Msg = GUIGetMsg()
        Switch $Msg

                Case $GUI_EVENT_CLOSE
                          Exit

      Case $msg = $Button1

                run("explorer.exe Y:\网络游戏\盛大传奇")
                Case $msg = $Button2
                        
                Run("explorer.exe X:\网络游戏\传奇世界")       
                Case $msg = $Button3
                        
                Run("explorer.exe Y:\网络游戏\劲舞团")
                Case $msg = $Button4
                        
                Run("explorer.exe X:\网络游戏\完美世界国际版")                                       
        EndSwitch
WEnd

83265358 发表于 2010-12-26 07:41:34

支持,继续努力,我也是新手。。

xuanfeng1234567 发表于 2010-12-26 10:04:32

MsgBox(0, "名仕网吧", "名仕网吧传奇私服群:84473853")
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=F:\Xu\AU3\私服登录器目录\Form1.kxf
$Form1 = GUICreate("名仕网吧欢迎您", 414, 263, 192, 114)
$Button1 = GUICtrlCreateButton("盛大传奇私服", 48, 40, 137, 49)
$Button2 = GUICtrlCreateButton("传奇世界私服", 224, 40, 137, 49)
$Button3 = GUICtrlCreateButton("劲舞团私服", 48, 128, 137, 49)
$Button4 = GUICtrlCreateButton("完美世界私服", 224, 128, 137, 49)
$Label1 = GUICtrlCreateLabel("请选择您要玩的私服,点击后再将登录器放入弹出文件夹内即可", 32, 216, 340, 17)
GUISetState()
#EndRegion ### END Koda GUI section ###

While 1
      $Msg = GUIGetMsg()
      Switch $Msg

                Case $GUI_EVENT_CLOSE
                        Exit

      Case $Button1

                run("explorer.exe Y:\网络游戏\盛大传奇")
                Case $Button2
                        
                Run("explorer.exe X:\网络游戏\传奇世界")      
                Case $Button3
                        
                Run("explorer.exe Y:\网络游戏\劲舞团")
                Case $Button4
                        
                Run("explorer.exe X:\网络游戏\完美世界国际版")                                       
                EndSwitch
        WEnd
        稍作修改...不知是否可以呢?

shengtools 发表于 2010-12-26 12:45:04

支持,我也是新手,学习中

lixiaolong 发表于 2010-12-26 12:59:46

回复 1# lengfeng57

使用Switch的话不用 case $msg = $xxx 的格式,
直接使用 case $xxx 就可以了.

tryhi 发表于 2010-12-26 13:55:01

发帖没用,缩进不合理,这就是不对的地方

5i5wei 发表于 2010-12-26 14:13:52

支持中 {:face (332):}{:face (382):}
页: [1]
查看完整版本: 新手学GUI,帮忙看看哪里不对!