Files
docs-desktop/dotnet-desktop-guide/framework/wpf/controls/textblock-overview.md
T
Andy (Steve) De George be103da07e Replace various WPF include files with content (#1335)
* net-current-v30plus-md.md

* net-current-v40plus-md.md

* tla2sharptla-ui-md.md

* tla2sharptla-uiautomation-md.md

* tla2sharptla-winclient-md.md

* tla2sharptla-xaml-md.md

* tlasharptla-ui-md.md

* tlasharptla-uiautomation-md.md

* tlasharptla-winclient-md.md

* tlasharptla-xaml-md.md

* fix warnings
2022-03-16 12:14:11 -04:00

1.6 KiB

title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title ms.date dev_langs helpviewer_keywords ms.assetid
TextBlock Overview 03/30/2017
csharp
vb
controls [WPF], TextBlock
TextBlock control [WPF]
24720bca-341a-4b03-8a6b-7a678023b10a

TextBlock Overview

The xref:System.Windows.Controls.TextBlock control provides flexible text support for UI scenarios that do not require more than one paragraph of text. It supports a number of properties that enable precise control of presentation, such as xref:System.Windows.Controls.TextBlock.FontFamily%2A, xref:System.Windows.Controls.TextBlock.FontSize%2A, xref:System.Windows.Controls.TextBlock.FontWeight%2A, xref:System.Windows.Controls.TextBlock.TextEffects%2A, and xref:System.Windows.Controls.TextBlock.TextWrapping%2A. Text content can be added using the xref:System.Windows.Controls.TextBlock.Text%2A property. When used in XAML, content between the open and closing tag is implicitly added as the text of the element.

A xref:System.Windows.Controls.TextBlock element can be instantiated very simply using XAML.

[!code-xamlTextBlockSnip_XAML#2]

Similarly, usage of the xref:System.Windows.Controls.TextBlock element in code is relatively simple.

[!code-csharpTextBlockSnip#1] [!code-vbTextBlockSnip#1]

See also