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

[AU3基础] 用koda生成的窗口怎么在AU3里用啊?请各位帮忙看看:

  [复制链接]
发表于 2011-12-1 22:18:10 | 显示全部楼层 |阅读模式
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 347, 130, 512, 399)
$Label1 = GUICtrlCreateLabel("Label1", 16, 33, 36, 17)
$Input1 = GUICtrlCreateInput("Input1", 64, 29, 257, 21)
$Button1 = GUICtrlCreateButton("Button1", 144, 80, 81, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit


我现在是想让点一下$Button1 时执行代码,但是把这个代码直接放AU3里不能运行,提示 while error
发表于 2011-12-1 22:52:40 | 显示全部楼层
发表于 2011-12-2 02:56:52 | 显示全部楼层
用koda生成窗口, 当你想切换到Scite编辑器编辑代码, 可以按 F10
发表于 2011-12-2 03:09:45 | 显示全部楼层
1.代码不全,Switch没有使用EndSwitch闭合,While没有使用WEnd闭合
2.koda纯是一画图的,响应代码要自己在SciTe里去加。
如果想让它响应$button1
应该是
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        ;响应代码
        EndSwitch
WEnd

评分

参与人数 1金钱 +20 收起 理由
afan + 20

查看全部评分

发表于 2011-12-2 08:34:01 | 显示全部楼层
koda里面按 F9 ,有复制代码按钮。
发表于 2011-12-5 11:04:31 | 显示全部楼层
大不了复制,粘贴即可啊!!我就是这么干的
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-20 20:29 , Processed in 0.082844 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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