RichTextBox Konstruktorer
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Initierar en ny instans av RichTextBox klassen.
Överlagringar
| Name | Description |
|---|---|
| RichTextBox() |
Initierar en ny standardinstans av RichTextBox klassen. |
| RichTextBox(FlowDocument) |
Initierar en ny instans av RichTextBox klassen och lägger till en angiven FlowDocument som det ursprungliga innehållet. |
RichTextBox()
Initierar en ny standardinstans av RichTextBox klassen.
public:
RichTextBox();
public RichTextBox();
Public Sub New ()
Kommentarer
Den här konstruktorn skapar en tom FlowDocument som är associerad med egenskapen Dokument. Mer specifikt innehåller det tomma FlowDocument en enda Paragraph, som innehåller en enda Run som inte innehåller någon text.
Gäller för
RichTextBox(FlowDocument)
Initierar en ny instans av RichTextBox klassen och lägger till en angiven FlowDocument som det ursprungliga innehållet.
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)
Parametrar
- document
- FlowDocument
A FlowDocument som ska läggas till som det första innehållet i den nya RichTextBox.
Exempel
I följande exempel visas hur konstruktorn används.
// 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)