在网上查了很久,找到了两种解决办法,一种是比较死如下:
//strTxtShow = "10" + "²";
// strTxtShow = "10" + "³";
// strTxtShow = "10" + Encoding.Unicode.GetString(new byte[] { 0x74, 0x20 }, 0, 2);
// strTxtShow = "10" + Encoding.Unicode.GetString(new byte[] { 0x75, 0x20 }, 0, 2);
// strTxtShow = "10" + Encoding.Unicode.GetString(new byte[] { 0x76, 0x20 }, 0, 2);
// strTxtShow = "10" + Encoding.Unicode.GetString(new byte[] { 0x77, 0x20 }, 0, 2);
// strTxtShow = "10" + Encoding.Unicode.GetString(new byte[] { 0x78, 0x20 }, 0, 2);
// strTxtShow = "10" + Encoding.Unicode.GetString(new byte[] { 0x79, 0x20 }, 0, 2);
// strTxtShow = "10" + Convert.ToChar(0x00b9) + Convert.ToChar(0x00ba);
另一种就是比较灵活的,感谢谢stackoverflow
<StackPanel Orientation="Horizontal">
<TextBlock x:Name="amplitudeTxt1" Text="振幅" VerticalAlignment="Bottom" FontSize="14" Height="16"/>
<TextBlock x:Name="amplitudeTxt2"><Run Text="(10"/><Run BaselineAlignment="Superscript" x:Name="amplitudeTxt" FontSize="8" Text="-1"/><Run Text=")"/></TextBlock>
</StackPanel>
还有一种就是(注,wpf界面下可能会失效)
<Paragraph FontFamily="Palatino Linotype">
H<Run Typography.Variants="Subscript">2</Run>O
Footnote<Run Typography.Variants="Subscript">4</Run>
</Paragraph>