How to clear text content in RichTextBox

前端 未结 6 708
眼角桃花
眼角桃花 2020-12-15 02:53

After getting the text in the RichTextBox I want to clear the text. How can I do that?

TextRange txt = new TextRange(richtxtSNotice.Document.ContentStart, ri         


        
6条回答
  •  温柔的废话
    2020-12-15 03:28

    This is a simple way of doing it.

            public void Clear()
            {
                richTextBox1.SelectAll();
    
                richTextBox1.Selection.Text = "";
            }
    

提交回复
热议问题