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

[AU3基础] 请问如何实现点击复选框,如何自动全选输入框中的内容

[复制链接]
发表于 2012-7-16 01:57:00 | 显示全部楼层 |阅读模式
本帖最后由 jscpu 于 2012-7-16 09:50 编辑

点击复选框,如何自动全选输入框中的内容。
代码如下:
我想勾选复选框后,自动将键盘焦点放到输入框中,并且如果已有内容的话便自动全选里面的文字
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 623, 444, 192, 124)
$Checkbox1 = GUICtrlCreateCheckbox("选择我", 72, 120, 121, 17)
$Input1 = GUICtrlCreateInput("112233", 216, 120, 169, 21,$ES_PASSWORD)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

        EndSwitch
WEnd

评分

参与人数 1金钱 -20 收起 理由
afan -20 看版规,改标题

查看全部评分

发表于 2012-7-16 07:53:01 | 显示全部楼层
本帖最后由 鸟人 于 2012-7-16 07:54 编辑

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 623, 444, 192, 124)
$Checkbox1 = GUICtrlCreateCheckbox("选择我", 72, 120, 121, 17)
$Input1 = GUICtrlCreateInput("112233", 216, 120, 169, 21,$ES_PASSWORD)
GUISetState(@SW_SHOW)

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
        Case $Checkbox1
               GUICtrlSetState($Input1, $GUI_FOCUS)
              If GUICtrlRead($Input1)<>"" Then ClipPut(GUICtrlRead($Input1))
                     MsgBox(0,'',ClipGet())
        EndSwitch
WEnd
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-19 03:58 , Processed in 0.075305 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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