0

我创建 RichTextBox 并得到以下代码:

richTextBox1.SelectionFont = new Font("Verdana", 10, FontStyle.Regular);
richTextBox1.SelectionColor = Color.Blue;
richTextBox1.Text += "ddddd";

文字保持不变。我注意到richTextBox1.Text 将我的字体改回了默认字体。我该如何解决?

4

1 回答 1

1

尝试使用 AppendText 方法:

richTextBox1.SelectionFont = new Font("Verdana", 10, FontStyle.Regular);
richTextBox1.SelectionColor = Color.Blue;
richTextBox1.AppendText("ddddd");

richTextBox1.SelectionFont = myDefaultFont;
richTextBox1.SelectionColor = myDefaultColor;
于 2013-03-26T22:40:22.910 回答