Jump to content

Recommended Posts

Posted (edited)

I would like to change the font color of a GUICtrlCreateLabel from default black into another color - the problem I'm having is that I don't want it to be the global text color, instead, I want it to pertain just to the specific text.

Edited by enigmaforceiv
Posted

Where? In Word, in Excel, in a GUI control ....?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted (edited)

Hi,

Can you duplicate the question from the topic to your post please? I made few seconds to understand it was an arrow indicating "read the title".

Let's say you want to change the font color in your GUI, then it's not by the function GuiCtrlSetFont, but with the function GuiCtrlSetColor.

Br, FireFox.

Edited by FireFox
Posted

example. label

<GUIConstantsEx.au3>

Example()

Func Example()
Local $widthCell, $msg, $iOldOpt

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

GUISetHelp("notepad.exe") ; will run notepad if F1 is typed
$iOldOpt = Opt("GUICoordMode", 2)

$widthCell = 70
GUICtrlCreateLabel("Line 1 Cell 1", 10, 30, $widthCell) ; first cell 70 width
GUICtrlSetColor(-1,0xdf234d)
GUICtrlCreateLabel("Line 2 Cell 1", -1, 0) ; next line
GUICtrlSetColor(-1,0xfddf23)
GUICtrlCreateLabel("Line 3 Cell 2", 0, 0) ; next line and next cell
GUICtrlSetColor(-1,0xFFFFFF)
GUICtrlCreateLabel("Line 3 Cell 3", 0, -1) ; next cell same line
GUICtrlSetColor(-1,0x833454)
GUICtrlCreateLabel("Line 4 Cell 1", -3 * $widthCell, 0) ; next line Cell1
GUICtrlSetColor(-1,0x346323)

GUISetState() ; will display an empty dialog box

; Run the GUI until the dialog is closed
Do
$msg = GUIGetMsg()
Until $msg = $GUI_EVENT_CLOSE

$iOldOpt = Opt("GUICoordMode", $iOldOpt)
EndFunc ;==>Example

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...