TextBlock.Text Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
public:
property Platform::String ^ Text { Platform::String ^ get(); void set(Platform::String ^ value); };
winrt::hstring Text();
void Text(winrt::hstring value);
C#
public string Text { get; set; }
var string = textBlock.text;
textBlock.text = string;
Public Property Text As String
XAML
<TextBlock Text="string"/>
- or -
<TextBlock>string</TextBlock>
A string that specifies the text contents of this TextBlock. The default is an empty string.
This property is not nullable. However, if you set this property to null
(TextBlock1.Text = null;
) no exception is thrown. Instead, it is automatically set to an empty string ("").
Product | Versions |
---|---|
Windows App SDK | 0.8, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6 |