如何在RichtextBox中显示功能?

时间:2017-10-10 17:38:19

标签: c# winforms math pow

如何在这张照片的富文本框中显示权力的真实面貌?有人会提供一些代码或示例吗?

Image

1 个答案:

答案 0 :(得分:1)

请阅读example in MSDN

        richTextBox1.SelectionFont = new Font("Lucinda Console", 12);
        // Set the baseline text.
        richTextBox1.SelectedText = "x";
        // Set the CharOffset to display superscript text.
        richTextBox1.SelectionCharOffset = 10;
        richTextBox1.SelectionFont = new Font("Lucinda Console", 8);
        // Set the superscripted text.  
        richTextBox1.SelectedText = "2x";
        // Reset the CharOffset to display text at the baseline.
        richTextBox1.SelectionCharOffset = 0;