Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys!

I want to make my label subscript or superscript. I try using special character but it's very limited. For example if I want to do something like m4 (4 is superscripted) I can't find it in the special character list.

Do I have to add another class? If yes, may I know how to do it or provide me with the sample.

Thanks.
Posted
Updated 9-Nov-17 5:11am

I don't think you can do this in a straightforward label (and definitely can't be done in a normal textbox). However you could convert a richTextBox to get the same effect.

Have a look at this article[^] as it has some sample code.

Also see the solutions here[^]
 
Share this answer
 
I think I found out the best solution:

1. Use a RichTextBox with properties set with: BorderStyle none, BackColor control, and ReadOnly true.
2. Click here to set the offset. This is how subscript or superscript is set.
3. Click here to set the font attributes.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900