找回密码
 加入
搜索
查看: 2768|回复: 3

[AU3基础] 打开程式时怎样让光标定位在Input[已解决]

[复制链接]
发表于 2010-12-14 09:40:13 | 显示全部楼层 |阅读模式
本帖最后由 yikang8888 于 2010-12-14 10:22 编辑

如下代码,请教哪位高手,我怎样才能打开程式时把光标定位在$Input1!感谢
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=d:\autoit3\编程\form1.kxf
$Form1_1 = GUICreate("Auto Run Tool", 282, 336, 207, 121)
$Test = GUICtrlCreateTab(8, 0, 265, 321)
GUICtrlSetFont(-1, 8, 400, 0, "@黑体")
$TabSheet1 = GUICtrlCreateTabItem("Test")
$Input1 = GUICtrlCreateInput("Input1", 24, 264, 129, 29)
GUICtrlSetFont(-1, 12, 400, 0, "微软雅黑")
$Edit1 = GUICtrlCreateEdit("", 16, 24, 249, 209)
GUICtrlSetData(-1, "Edit1")
GUICtrlSetFont(-1, 12, 400, 0, "微软雅黑")
$Button1 = GUICtrlCreateButton("Button1", 168, 264, 97, 33)
GUICtrlSetFont(-1, 12, 400, 0, "微软雅黑")
$Label1 = GUICtrlCreateLabel("Label1", 24, 240, 53, 25)
GUICtrlSetFont(-1, 12, 400, 0, "微软雅黑")
$TabSheet2 = GUICtrlCreateTabItem("Tool")
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 88, 37, 113, 25)
$Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 88, 69, 113, 25)
$Checkbox3 = GUICtrlCreateCheckbox("Checkbox2", 88, 101, 113, 25)
$Checkbox4 = GUICtrlCreateCheckbox("Checkbox2", 88, 133, 113, 25)
$Checkbox5 = GUICtrlCreateCheckbox("Checkbox2", 88, 165, 113, 25)
$Input2 = GUICtrlCreateInput("Input2", 96, 200, 65, 21)
$Input3 = GUICtrlCreateInput("Input3", 96, 240, 65, 21)
$Input4 = GUICtrlCreateInput("Input4", 96, 272, 65, 21)
$Button2 = GUICtrlCreateButton("Button2", 176, 216, 73, 65)
$Label2 = GUICtrlCreateLabel("Label2", 16, 208, 36, 17)
$Label3 = GUICtrlCreateLabel("Label3", 16, 240, 36, 17)
$Label4 = GUICtrlCreateLabel("Label4", 16, 272, 36, 17)
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

                Case $Test
                Case $Checkbox1
        EndSwitch
WEnd

评分

参与人数 1金钱 +10 收起 理由
afan + 10 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

发表于 2010-12-14 09:53:32 | 显示全部楼层
GUICtrlSetState ( 控件ID, $GUI_FOCUS)

评分

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

查看全部评分

发表于 2010-12-14 10:05:24 | 显示全部楼层
$GUI_FOCUS,顶。。。
 楼主| 发表于 2010-12-14 10:22:13 | 显示全部楼层
OK了,感谢版主
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-27 20:17 , Processed in 0.168983 second(s), 28 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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