TextBlock Konstruktorer

Definition

Initierar en ny instans av TextBlock klassen.

Överlagringar

Name Description
TextBlock()

Initierar en ny instans av TextBlock klassen.

TextBlock(Inline)

Initierar en ny instans av TextBlock klassen och lägger till ett angivet Inline element som det första visningsinnehållet.

TextBlock()

Initierar en ny instans av TextBlock klassen.

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

Gäller för

TextBlock(Inline)

Initierar en ny instans av TextBlock klassen och lägger till ett angivet Inline element som det första visningsinnehållet.

public:
 TextBlock(System::Windows::Documents::Inline ^ inline);
public TextBlock(System.Windows.Documents.Inline inline);
new System.Windows.Controls.TextBlock : System.Windows.Documents.Inline -> System.Windows.Controls.TextBlock
Public Sub New (inline As Inline)

Parametrar

inline
Inline

Ett objekt som härleds från den abstrakta Inline klassen och som ska läggas till som det ursprungliga innehållet.

Undantag

inline är null.

Exempel

I följande exempel visas hur konstruktorn används. I det här fallet TextBlock innehåller innehåller en text Run.

TextBlock txtBlock = new TextBlock(new Run("A bit of text content..."));
Dim txtBlock As New TextBlock(New Run("A bit of text content..."))

Kommentarer

Giltiga indatatyper för inline inkluderar AnchoredBlock, InlineUIContainer, LineBreak, Runoch Span.

Gäller för