I need to put some subtext in a Winforms C# labels .Text property. Is there any easy way to do this without writng my own control?
This would be the example in HTML
<sub>1a</sub>
Thanks, Paul.
Here's a link to an already-written control that does exactly this:
http://www.freshnova.com/C-Tutorials/superscript-subscript-label.html
Update: you can also just use a RichTextBox (with BorderStyle none, BackColor control, and ReadOnly true). The RichTextBox's SelectionCharOffset lets you specify the height of text above or below the baseline in pixels, and then set its SelectedText property after each setting of SelectionCharOffset to mix-and-match text of different positions in the one box.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With