Function Reference

GUICtrlSetColor

Sets the text color of a control.

GUICtrlSetColor ( controlID, textcolor)

 

Parameters

controlID The control identifier (controlID) as returned by a GUICtrlCreate... function.
textcolor The RGB color to use.

 

Return Value

Success: Returns 1.
Failure: Returns 0.

 

Remarks

Only Label, Checkox, Group, Radio, Edit, Input, List, Listview, ListviewItem, Treeview, TreeviewItem, Graphic and Progress controls can currently be colored.

Progress controls cannot be painted if the "Windows XP style" is used.

Earlier versions of AutoIt (prior to v3.0.102) used the BGR format for defining color - newer versions use RGB by default but this can be changed using the ColorMode option.

 

Related

ColorMode (Option), GUICtrlCreate..., GUICtrlSetBkColor

 

Example


#include <GUIConstants.au3>

GUICreate("My GUI color text")  ; will create a dialog box that when displayed is centered

GUICtrlCreateLabel ("my Red label", 10,20)
GUICtrlSetColor(-1,0xff0000)    ; Red
               
GUISetState ()

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
   
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend