How to get RTF from RichTextBox

前端 未结 2 1555
离开以前
离开以前 2020-12-09 05:24

How do I get the text in RTF of a RichTextBox? I\'m trying to get like this, but the property does not exist.

RichTextBox rtb = new RichTextBox(         


        
2条回答
  •  天命终不由人
    2020-12-09 06:00

    There are 2 RichTextBox classes, one from the winforms framework and one from the WPF framework:

    System.Windows.Controls.RichTextBox wpfBox;
    System.Windows.Forms.RichTextBox winformsBox;
    

    Only the Winforms RichTextBox has an Rtf property, the other has a Document property which contains a FlowDocument.

提交回复
热议问题