0

My problem seems simple, yet I can not find any soltion to it. I need to write mathematical desciptions to Labels in my WindowsForms application. So some labels need Texts written to them like: ValueIndex or ValueIndex

I find no solution for this. HTML formating of the labels does not allow sub or sup, I feel like the first person ever in the need for this.

I am using Windows Forms and DevExpress for WindowsForms, can someone please point me to a hint?

Lorgarn
  • 136
  • 1
  • 15

2 Answers2

0

I know a control that can display subscript and superscript. It is RichTextEditor. However, I know only one way to format text in code - using API provided by this control.

Using API, it is possible to obtain document elements and modify character properties. The code snippet demonstrating how to do this is available in the online documentation: CharacterPropertiesBase Interface. You need to modify the following properties:

CharacterPropertiesBase.Subscript Property

CharacterPropertiesBase.Superscript Property

Uranus
  • 1,690
  • 1
  • 12
  • 22
0

If you're talking about a Winform, I would just use two labels positioned flush next to each other. The first label would have the value, the second the superscript. With the second label being styled to look like a superscript.

[Label1 = Value][Label2 = Superscript of Value]

You probably want to work it into a custom control if you're going to be doing this all over the place.

Marcus
  • 166
  • 6