Język

RichTextBox Konstruktory

Definicja

Inicjuje nowe wystąpienie klasy RichTextBox.

Przeciążenia

Nazwa Opis
RichTextBox()

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

RichTextBox(FlowDocument)

Inicjuje nowe wystąpienie RichTextBox klasy, dodając określony 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 obiekt FlowDocument skojarzony z właściwością Document. W szczególności puste FlowDocument zawiera jeden Paragraphelement , który zawiera pojedynczy element Run , który nie zawiera żadnego tekstu.

Dotyczy

RichTextBox(FlowDocument)

Inicjuje nowe wystąpienie RichTextBox klasy, dodając określony 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