本帖最后由 heroxianf 于 2017-7-6 13:42 编辑
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Global $test = True
$hGui = GUICreate("闪烁测试", 615, 438, 676, 314)
$Label1 = GUICtrlCreateLabel("背景闪烁", 102, 96, 198, 17)
$Input1 = GUICtrlCreateInput("", 102, 141, 196, 21)
GUISetState(@SW_SHOW)
AdlibRegister("test", 500) ;定时清理内存
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
AdlibUnRegister("test")
Exit
EndSwitch
WEnd
Func test()
If GUICtrlRead($Input1) = "" Then ;检测输入框 空就闪烁 不空停止
If $test Then
GUICtrlSetBkColor($Label1, 0xDF5D26)
$test = False
Else
GUICtrlSetBkColor($Label1, 0x81C0C0)
$test = True
EndIf
Else
GUICtrlSetBkColor($Label1, $GUI_BKCOLOR_TRANSPARENT) ;设置背景色为默认色
EndIf
EndFunc
|