简体   繁体   中英

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

Watch this image:

在此处输入图片说明

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM