在C#中向RichTextBox添加字符串
我目前有一个函数将一个值设置为RichTextBox,虽然你怎么能“添加”一个值或一个新行,而不是覆盖RichTextBox中的现有数据?
richTextBox2.Text = DateTime.Today + " Hello";
richTextBox2.AppendText(Environment.NewLine + DateTime.Today + " Hello");
richTextBox2.AppendText(String.Format("{0} the date is {1}{2}", "Hello", DateTime.Today, Environment.NewLine));
请不要使用+
richTextBox2.Document.Blocks.Clear(); richTextBox2.Document.Blocks.Add(new Paragraph(new Run("string")));
richTextBox2.Text = "Something " + richTextBox2.Text + " and something"