2017-10-10 59 views

回答

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; 
+2

** NB **設置SelectionFont時,您用於SelectionCharOffset的值將取決於字體大小。例如。如果你的字體大小是48點,SelectionCharOffset爲10是不夠的;你會想要更像44的東西。試試數字,直到你看到你想要的樣子。 –