Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you clear a WPF RichTextBox?

Whenever I do richtextbox1.Clear() it says the method doesn't exist. And it's pretty much the only solution I get, everywhere I go.

I've tried looking for a Text property, and I've tried to look through the Document property as well, but to no avail.

What I am missing? The box needs to be cleared, like you can do with a textbox.Clear() call.

like image 603
OmniOwl Avatar asked Apr 20 '13 22:04

OmniOwl


1 Answers

You can clear a RichTextBox with richTextBox.Document.Blocks.Clear();

like image 148
Mike Precup Avatar answered Oct 14 '22 23:10

Mike Precup