Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF: power in xaml

I have text block with text "km2":

<TextBlock >Area(km2)</TextBlock>

How can I make "2" small and heigher such exponent I need view such on picture: enter image description here

like image 846
Yaroslav Shabanov Avatar asked Sep 04 '13 17:09

Yaroslav Shabanov


2 Answers

You can create Inlines, and set Typography.Variants appropriately.

<TextBlock><Run>Area(km</Run><Run Typography.Variants="Superscript">2</Run><Run>)</Run></TextBlock>
like image 153
Reed Copsey Avatar answered Nov 01 '22 20:11

Reed Copsey


<TextBlock Text="Area(km²)"/>

Seems to work:

like image 44
Olivier Payen Avatar answered Nov 01 '22 20:11

Olivier Payen