请问如何实现点击复选框,如何自动全选输入框中的内容
点击复选框,如何自动全选输入框中的内容。代码如下:
我想勾选复选框后,自动将键盘焦点放到输入框中,并且如果已有内容的话便自动全选里面的文字#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 本帖最后由 南一 于 2012-7-16 11:01 编辑
#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
Case $Checkbox1
$Checked = GUICtrlRead($Checkbox1)
If $Checked = $GUI_CHECKED Then
GUICtrlSetState($Input1, $GUI_FOCUS)
EndIf
EndSwitch
WEnd
页:
[1]