RichTextBox.Document 속성

정의

FlowDocument의 콘텐츠를 나타내는 RichTextBox를 가져오거나 설정합니다.

public:
 property System::Windows::Documents::FlowDocument ^ Document { System::Windows::Documents::FlowDocument ^ get(); void set(System::Windows::Documents::FlowDocument ^ value); };
public System.Windows.Documents.FlowDocument Document { get; set; }
member this.Document : System.Windows.Documents.FlowDocument with get, set
Public Property Document As FlowDocument

속성 값

FlowDocument

FlowDocument의 콘텐츠를 나타내는 RichTextBox 개체입니다.

기본적으로 이 속성은 빈 FlowDocument로 설정됩니다. 특히 이 빈 FlowDocument에는 텍스트를 포함하지 않는 단일 Paragraph이 들어 있는 단일 Run가 포함됩니다.

예외

해당 속성을 null로 설정하려고 한 경우

이 속성을 다른 FlowDocument의 콘텐츠를 나타내는 RichTextBox로 설정하려고 한 경우

변경 블록이 활성화된 상태에서 이 속성을 설정한 경우

예제

다음 예제에서는이 속성의 사용을 보여 줍니다.

// Create a simple FlowDocument to serve as content.
FlowDocument flowDoc = new FlowDocument(new Paragraph(new Run("Simple FlowDocument")));
// Create an empty, default RichTextBox.
RichTextBox rtb = new RichTextBox();
// This call sets the contents of the RichTextBox to the specified FlowDocument.
rtb.Document = flowDoc;
// This call gets a FlowDocument representing the contents of the RichTextBox.
FlowDocument rtbContents = rtb.Document;
' Create a simple FlowDocument to serve as content.
Dim flowDoc As New FlowDocument(New Paragraph(New Run("Simple FlowDocument")))
' Create an empty, default RichTextBox.
Dim rtb As New RichTextBox()
' This call sets the contents of the RichTextBox to the specified FlowDocument.
rtb.Document = flowDoc
' This call gets a FlowDocument representing the contents of the RichTextBox.
Dim rtbContents As FlowDocument = rtb.Document

설명

FlowDocument는 단일 RichTextBox에서만 호스팅될 수 있습니다. 단일 FlowDocument를 여러 RichTextBox 컨트롤의 내용으로 지정하는 것은 지원되지 않습니다.

적용 대상