回复 1# 765058729
不知道是不是你所需要的...
Local $NONEAACTIVECOLOR = 0x989898
$GUI = GUICreate("检测输入框演示例子", 280, 150)
$Input_1 = GUICtrlCreateInput('', 15, 20, 250, 20)
GUICtrlSetColor(-1, $NONEAACTIVECOLOR)
$Input_2 = GUICtrlCreateInput('', 15, 60, 250, 20)
GUICtrlSetColor(-1, $NONEAACTIVECOLOR)
$Input_3 = GUICtrlCreateInput('', 15, 100, 250, 20)
GUICtrlSetColor(-1, $NONEAACTIVECOLOR)
$aboutButton = GUICtrlCreateButton("中文论坛", 100, 125, 60, 20)
$ExitButton = GUICtrlCreateButton("退出", 200, 125, 60, 20,1)
ControlFocus($GUI,'',$ExitButton)
GUISetState()
While 1
_CheckInput($GUI, $Input_1, "点击这里输入内容")
_CheckInput($GUI, $Input_2, "AU3最佳中文论坛")
_CheckInput($GUI, $Input_3, "www.autoitX.com")
Switch GUIGetMsg()
Case $aboutButton
ShellExecute("www.autoitX.com")
Case $ExitButton, -3
Exit
EndSwitch
WEnd
Func _CheckInput($hWnd, $ID, $DefaultInputData)
If _IsFocused($hWnd, $ID) And $DefaultInputData = GUICtrlRead($ID) Then
GUICtrlSetData($ID, "")
GUICtrlSetColor($ID, 0x000000)
ElseIf Not _IsFocused($hWnd, $ID) And GUICtrlRead($ID) = "" Then
GUICtrlSetData($ID, $DefaultInputData)
GUICtrlSetColor($ID, $NONEAACTIVECOLOR)
EndIf
EndFunc
Func _IsFocused($hWnd, $nCID)
Return ControlGetHandle($hWnd, '', $nCID) = ControlGetHandle($hWnd, '', ControlGetFocus($hWnd))
EndFunc
|