RichTextBox Constructors
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the RichTextBox class.
RichTextBox() |
Initializes a new, default instance of the RichTextBox class. |
RichTextBox(FlowDocument) |
Initializes a new instance of the RichTextBox class, adding a specified FlowDocument as the initial content. |
Initializes a new, default instance of the RichTextBox class.
public:
RichTextBox();
public RichTextBox();
Public Sub New ()
Remarks
This constructor creates an empty FlowDocument that is associated with the Document property. Specifically, the empty FlowDocument contains a single Paragraph, which contains a single Run which contains no text.
Applies to
.NET Framework 4.8.1 dan versi lain
Produk | Versi |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
Initializes a new instance of the RichTextBox class, adding a specified FlowDocument as the initial content.
public:
RichTextBox(System::Windows::Documents::FlowDocument ^ document);
public RichTextBox(System.Windows.Documents.FlowDocument document);
new System.Windows.Controls.RichTextBox : System.Windows.Documents.FlowDocument -> System.Windows.Controls.RichTextBox
Public Sub New (document As FlowDocument)
Parameters
- document
- FlowDocument
A FlowDocument to be added as the initial contents of the new RichTextBox.
Examples
The following example illustrates use of this constructor.
// Create a simple FlowDocument to serve as the content input for the construtor.
FlowDocument flowDoc = new FlowDocument(new Paragraph(new Run("Simple FlowDocument")));
// After this constructor is called, the new RichTextBox rtb will contain flowDoc.
RichTextBox rtb = new RichTextBox(flowDoc);
' Create a simple FlowDocument to serve as the content input for the construtor.
Dim flowDoc As New FlowDocument(New Paragraph(New Run("Simple FlowDocument")))
' After this constructor is called, the new RichTextBox rtb will contain flowDoc.
Dim rtb As New RichTextBox(flowDoc)
Applies to
.NET Framework 4.8.1 dan versi lain
Produk | Versi |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
.NET maklum balas
.NET ialah projek sumber terbuka. Pilih pautan untuk memberikan maklum balas: