Sign in to follow this  
Followers 0
enigmaforceiv

Is there a way to change the color of a font?

5 posts in this topic

#1 ·  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

Share this post


Link to post
Share on other sites



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


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  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

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

Updated, sorry was at that "point" of knocking out trying to figure out this new issue! haha

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0