When a selection in WindowsForms RichTextbox uses two or more different font sizes (eg. you select text with font size 9 and some other text with font size 16 in the same selection), SelectionFont.Size always returns 13. Is there any way to detect that two different sizes are selected?
When a selection in WindowsForms RichTextbox uses two or more different font sizes (eg.
Share
If a range is selected which contains items that have the same font,
but different sizes, the control incorrectly reports that the selection contains a font with size 13. I’m not certain this can be fixed. Perhaps it’s always 13 in this case, perhaps not, I don’t know.
But i use the follow Solution …
Found via Reflection in Methode
Example Code:
Content => The RichTextBox-Control
Helper Methode (Class):