How to determine width of new/selected text in a RichTextBox
I have a RichtextBox that I'm populating with text by finding certain string patterns/fields and replacing them with real values. In some cases the new strings need to be right aligned within the original string pattern/field width.
To do that I would need to know how to determine width of new/selected text (given text size, font family, etc.) so that I can 'left pad' it with appropriate number of filler spaces.
Therefore my question is how can I determine text size in a RichtextBox?