Hi,
I have a richtextbox in which I'd like to set only specific text to bold and/or red color.
I now have f.e. richtextbox1.text += 'MyText'
If I'd like to add $richtextbox1.text += 'MyTextBold', how do I do that?
Tried with $richtextbox1.SelectionFont.Bold = $true but it says it is readonly(?)
Thanks!
S.
Richtextbox: set only specific text in bold and/or other color
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.
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.
Re: Richtextbox: set only specific text in bold and/or other color
Start by reading the documentation for the RTB and read how to use the methods and decide whether to use RTF strings or to use primitives.
Everything you asked is on this page: https://docs.microsoft.com/en-us/dotnet ... esktop-6.0
Everything you asked is on this page: https://docs.microsoft.com/en-us/dotnet ... esktop-6.0
Re: Richtextbox: set only specific text in bold and/or other color
Here is an RTB sampler I built years ago to demonstrate various methods useful with an RTB.
- Attachments
-
- Demo-RTFColors.psf
- (22.45 KiB) Downloaded 98 times