没选成蓝色的,只是点击会清除。参考吧。
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 405, 120, 193, 125)
$Input1 = GUICtrlCreateInput("这里输入数字", 24, 16, 201, 21)
$Button1 = GUICtrlCreateButton("Button1", 136, 72, 121, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $GUI_EVENT_PRIMARYDOWN
mouseCHK()
Case $Button1
GUICtrlSetData($Input1,"这里输入数字")
EndSwitch
WEnd
Func mouseCHK()
$MS=GUIGetCursorInfo($Form1)
if $MS[4]=$Input1 And GUICtrlRead($Input1)="这里输入数字" Then
GUICtrlSetData($Input1,"")
EndIf
EndFunc
|