Jump to content

How to change text color into variable


cu0x
 Share

Recommended Posts

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!

Link to comment
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 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
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!

Link to comment
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!

 

Link to comment
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!

Link to comment
Share on other sites

:)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
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
 Share

  • Recently Browsing   0 members

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