Click here to Skip to main content
12,887,933 members (43,818 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# .NET
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.

Posted 20-Feb-13 21:39pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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[^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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.

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

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170424.1 | Last Updated 25 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100