truefriendlion
truefriendlion

Reputation: 11

system.windows.forms.richtextbox does not contain document in C#

Watch this image:

enter image description here

TextRange tr = new TextRange(richTextBox1.Document.ContentStart, richTextBox1.Document.ContentEnd);

Error system.windows.forms.richtextbox does not contain document

Upvotes: 1

Views: 634

Answers (1)

MarkusEgle
MarkusEgle

Reputation: 3065

It is like your error message already tries to tell you.

The RichTextBox class definition in WinForms doesn't contain a property Document.

You could assign your content to the richTextBox1.text property or use richTextBox1.LoadFile(). Please have a look at the MSDN documentation: RichTextBox Class

Upvotes: 1

Related Questions