TextBlock Constructeurs
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Initialise une nouvelle instance de la classe TextBlock.
Surcharges
| Nom | Description |
|---|---|
| TextBlock() |
Initialise une nouvelle instance de la classe TextBlock. |
| TextBlock(Inline) |
Initialise une nouvelle instance de la TextBlock classe, en ajoutant un élément spécifié Inline comme contenu d’affichage initial. |
TextBlock()
Initialise une nouvelle instance de la classe TextBlock.
public:
TextBlock();
public TextBlock();
Public Sub New ()
S’applique à
TextBlock(Inline)
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)
Paramètres
Exceptions
inline a la valeur null.
Exemples
L’exemple suivant illustre l’utilisation de ce constructeur. Dans ce cas, le TextBlock texte contient un texte Run.
TextBlock txtBlock = new TextBlock(new Run("A bit of text content..."));
Dim txtBlock As New TextBlock(New Run("A bit of text content..."))
Remarques
Types d’entrée valides pour inline include, , AnchoredBlockInlineUIContainer, LineBreak, et RunSpan.