Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Formatting text inside a label in windows app

Tags:

.net

winforms

wpf

I want to add text to my label as: area(m^2) but 2 should be in power of m.

Is it possible in .NET to do this?

like image 242
Shobha Singh Avatar asked Oct 06 '22 22:10

Shobha Singh


2 Answers

enter image description here

<Label Content="2 power of 3 => 3 &#x00B2; " />

instead of U+00B2 i wrote &#x00B2;

But if you want to write it by C# code you have to use the first format

label.Content = "\u00B2";
like image 163
HB MAAM Avatar answered Oct 10 '22 01:10

HB MAAM


Use the superscript 2 character ² (unicode U+00B2).

like image 30
lc. Avatar answered Oct 10 '22 02:10

lc.