❔ Problems with applying multiple styles on text in RichTextBox
Im trying to apply some styles to a piece of text in a richTextBox and they just won't work properly.
Here is an example: "BeamMP Description".
I want to make the last 2 characters of the word "BeamMP" bold (MP) and the second word bold and underlined. So for the first word i do this:
I set the
selectionStart
to 0 and the selectionLength
to the end of the RTBox. Then this:
RTBox.SelectionFont = new Font(RTBox.SelectionFont, RTBox.SelectionFont.Style | FontStyle.Bold);
Similar way to underline the word "Description"
But the problem here is that the bolding magically dissapears and only the underline at the word Description is applied???9 Replies
Here you go
RTBox.Select(5,18);
RTBox.SelectionFont = new Font(RTBox.SelectionFont, RTBox.SelectionFont.Style | FontStyle.Bold);
RTBox.Select(7, 18);
RTBox.SelectionFont = new Font(RTBox.SelectionFont, RTBox.SelectionFont.Style | FontStyle.Underline);
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.Still doesn't work properly
does it use winforms .net framework .net 6 or not winforms entirely
winforms net framework
i few more questions one is when you say it does not work does that mean the the end text is no longer bold and just underlined and 2 is, is RTBox just the name of the richtextbox or are you using some sort of gui add on for winforms
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.yes, the text is no longer bold and yes, RTBox is just the name of the richtextbox
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.