#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 381, 201, 192, 124)
$Label1 = GUICtrlCreateLabel("如何让鼠标移到此处,文本改变颜色呢", 40, 80, 280, 17)
GUICtrlSetColor($Label1, 0x0000ff)
GUICtrlSetCursor(-1, 0)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
AdlibRegister('_set_lb_color', 600)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $Label1
MsgBox(0, "hello", "hello")
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _set_lb_color()
Local $aCur = GUIGetCursorInfo($Form1)
If Not IsArray($aCur) Then Return
If $aCur[4] == $Label1 Then
GUICtrlSetColor($Label1, 0xff0000)
Else
GUICtrlSetColor($Label1, 0x0000ff)
EndIf
EndFunc
|