0

I'd like to display e^x = answer in a label on a Windows Form, but using the appropriate superscript rather than ^x.

x is the user's input from a text box, answer is Math.Exp(x). All of the variables are declared and the calculations are done after the user clicks the e^x button (it's a simple calculator application).

Unicode for superscript 4-9 is \u2074 to \u2079. I just realized superscript 2 and 3 follow a different pattern, but I'll worry about that later

I've been trying various ways to concatenate \\u207 and my x variable but the result displayed on my label is either \u207x or System.Char[]

Is there a way to do what I'm trying to accomplish? Or am I approaching this the wrong way?

AK_
  • 7,981
  • 7
  • 46
  • 78
Robert Lacher
  • 656
  • 1
  • 6
  • 16
  • Im guessing youll need this http://msdn.microsoft.com/en-us/library/system.windows.forms.richtextbox.aspx – AK_ Jun 21 '14 at 15:13

1 Answers1

2

This does not work with standard label. Refer to this question how to do it using HtmlRenderer

How to add superscript power operators in c# winforms

Community
  • 1
  • 1
adjan
  • 13,371
  • 2
  • 31
  • 48