Richtextbox Text Colour (Certain words)

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 5 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
dank42
Posts: 61
Last visit: Tue Apr 26, 2022 7:49 am

Richtextbox Text Colour (Certain words)

Post by dank42 »

Hi,

Is it possible to change the colour of certain words within a richtexbox from an Out-String?
e.g.

Status :Completed
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Richtextbox Text Colour (Certain words)

Post by jvierra »

Yes. Just set the color before outputting the word and set it back after the word. It will have to be appended in pieces. You can also convert the text to RTF text that specifies a color for the word.
This topic is 5 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked