RichTextBox Konstruktory

Definicja

Inicjuje nowe wystąpienie klasy RichTextBox.

Przeciążenia

RichTextBox()

Inicjuje nowe, domyślne wystąpienie RichTextBox klasy.

RichTextBox(FlowDocument)

Inicjuje RichTextBox nowe wystąpienie klasy, dodając określone FlowDocument jako początkową zawartość.

RichTextBox()

Inicjuje nowe, domyślne wystąpienie RichTextBox klasy.

public:
 RichTextBox();
public RichTextBox ();
Public Sub New ()

Uwagi

Ten konstruktor tworzy pusty FlowDocument element skojarzony z właściwością Document. W szczególności wartość pusta FlowDocument zawiera pojedynczy Paragraphelement , który zawiera jeden Run , który nie zawiera tekstu.

Dotyczy

RichTextBox(FlowDocument)

Inicjuje RichTextBox nowe wystąpienie klasy, dodając określone FlowDocument jako początkową zawartość.

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)

Parametry

document
FlowDocument

Element do FlowDocument dodania jako początkowa zawartość nowego RichTextBoxelementu .

Przykłady

Poniższy przykład ilustruje użycie tego konstruktora.

// 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)

Dotyczy