cu0x

How to change text color into variable

6 posts in this topic

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



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 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

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

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

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

:)


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

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