#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("label颜色演示", 274, 55, 192, 124)
$Label1 = GUICtrlCreateLabel("我是蓝色", 24, 16, 228, 17, $SS_CENTER)
GUICtrlSetColor(-1, 0x0000ff)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Label1
Select
Case GUICtrlRead($Label1) = "我是蓝色"
GUICtrlSetData($Label1, "我是绿色")
GUICtrlSetColor($Label1, 0x00FF00)
Case GUICtrlRead($Label1) = "我是绿色"
GUICtrlSetData($Label1, "我是红色")
GUICtrlSetColor($Label1, 0xFF0000)
Case GUICtrlRead($Label1) = "我是红色"
GUICtrlSetData($Label1, "我是蓝色")
GUICtrlSetColor($Label1, 0x0000FF)
EndSelect
EndSwitch
WEnd
|