Textbox.Multiline: Formatting appended text per-line

Ask your PowerShell-related questions, including questions on cmdlet development!
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 11 years and 5 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
StupidSexyFlanders
Posts: 107
Last visit: Thu Apr 29, 2021 8:47 am

Textbox.Multiline: Formatting appended text per-line

Post by StupidSexyFlanders »

I am using a forloop to add information (using appendtext) to a multiline textbox. Can the text be formatted differently on a per-line basis? For example, could I leave the first line at the default formatting and make the next line bold?

$outputWindow.AppendText("Default text format")
$outputWindow.AppendText("Bold text")

Whenever I define formatting per-line it changes all the text in the box to the formatting of the most recently added line.
Mike
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Textbox.Multiline: Formatting appended text per-line

Post by jvierra »

No - try using an RichText Control which allows formatting.
This topic is 11 years and 5 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