RichTextBox.Document Tulajdonság
Definíció
Fontos
Egyes információk olyan, kiadás előtti termékekre vonatkoznak, amelyek a kiadásig még jelentősen módosulhatnak. A Microsoft nem vállal kifejezett vagy törvényi garanciát az itt megjelenő információért.
Lekéri vagy beállítja a FlowDocument tartalmának jelölőt 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
Tulajdonság értéke
Ez a tulajdonság alapértelmezés szerint üres FlowDocument. Az üres FlowDocument elem egyetlen Paragraph, amely egyetlen szöveget nem tartalmazó egyetlen Run elemet tartalmaz.
Kivételek
Megkísérli beállítani ezt a tulajdonságot a következőre null: .
A rendszer kísérletet tesz arra, hogy ezt a tulajdonságot egy FlowDocument másik RichTextBoxtartalomnak megfelelő értékre állítsa.
Ez a tulajdonság a változásblokk aktiválása közben van beállítva.
Példák
Az alábbi példa a tulajdonság használatát mutatja be.
// 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
Megjegyzések
A FlowDocument-eket csak egyetlen RichTextBoxrendszer üzemeltetheti. Egyetlen FlowDocument megadása nem támogatott, mivel több RichTextBox vezérlő tartalma nem támogatott.