RichTextBox Constructors
Definition
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.
Overloads
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. |
RichTextBox()
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
RichTextBox(FlowDocument)
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
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기