Jump to content
cu0x

How to change text color into variable

Recommended Posts

cu0x

Hi guys,

I´m trying to change the color of a Variable, but just a part of it, the Variable will be later text for a label.

Something like this : Hello World!

 

Doest anyone know how to do it?

 

Appreciate your help!

Share this post


Link to post
Share on other sites
water

Welcome to AutoIt and the forum!
You can't set the colour in a variable, but there are UDFs available on the forum. This thread is a good starting point.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
AdmiralAlkex

Do you mean label as in GUICtrlCreateLabel()? You would use GUICtrlSetColor(), but that will color it all, not just one word. Exactly what is it you want to do?

Welcome to the forum!

Share this post


Link to post
Share on other sites
cu0x

Do you mean label as in GUICtrlCreateLabel()? You would use GUICtrlSetColor(), but that will color it all, not just one word. Exactly what is it you want to do?

Welcome to the forum!

exacly what I´m trying to do is to set color to just a part of the "data" of the GUICtrlCreateLabel(). My Label data is set as follow:

    If @error = 0 Then
        Local $sData = $IPLabelText & $aArray[1] & @CRLF & _
                $SubnetzmaskeLabelText & $aArray[2] & @CRLF & _
                $GWLabelText & $aArray[3] & @CRLF & _
                $DNSLabelText & $aArray[4] & @CRLF & _
                $DNSSuffixLabelText & $aArray[5]
    EndIf

It´s like a package of Arrays and wonna give them color in case of failure :S

I know that it´s complicated but dont wonna create a Label for each Array

 

Thanks!

 

Share this post


Link to post
Share on other sites
cu0x

Welcome to AutoIt and the forum!
You can't set the colour in a variable, but there are UDFs available on the forum. This thread is a good starting point.

Thats what im looking for, some kind of UDF :) Thanks for your help!

Share this post


Link to post
Share on other sites
water

:)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

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

×