首先添加上角标
Button button = new Button();
Run left=new Run("x");
Run right = new Run("2");
right.BaselineAlignment=BaselineAlignment.Superscript;
TextBlock textBlock = new TextBlock();
textBlock.Inlines.Add(left);
textBlock.Inlines.Add(right);
button.Content = textBlock;
![结果](https://img-blog.csdnimg.cn/3dbf408bbc1647a8a419d85e642af8df.png#pic_center)