

For more info about versions, see Version adaptive code. If your app is run on an earlier version of Windows, these conditions will also cause your text to render on the slow path.
Many text blocks windows#
Note Prior to Windows 10, version 1607, additional properties also affect the fast path.
Many text blocks code#

The inline Hyperlink element lets you add a hyperlink to your text. For more info, see the Formatting text section.
Text can be bold, underlined,Įlements derived from the Inline class, such as Bold, Italic, Run, Span, and LineBreak, enable different formatting for different parts of the text. You can also add content by placing inline flow content elements in the TextBox.Inlines property, like this. The most common way to display text is to set the Text property to a string value, as shown in the previous example. There are two properties you can use to add content to a TextBlock: Text and Inlines.
Many text blocks how to#
Here's how to define a simple TextBlock control and set its Text property to a string. Get the app from the Microsoft Store or get the source code on GitHub The WinUI 3 Gallery app includes interactive examples of most WinUI 3 controls, features, and functionality. Open the WinUI 3 Gallery app and see the TextBlock in action. Use a RichTextBlock when you need support for multiple paragraphs, multi-column text or other complex text layouts, or inline UI elements like images.įor more info about choosing the right text control, see the Text controls article. It also provides many of the same formatting options for customizing how your text is rendered.Īlthough you can put line breaks in the text, text block is designed to display a single paragraph and doesn't support text indentation. You can easily access and use text from a text block in your app by getting the value of the Text property. Is this the right control?Ī text block is typically easier to use and provides better text rendering performance than a rich text block, so it's preferred for most app UI text. You can use it to display single-line or multi-line text, inline hyperlinks, and text with formatting like bold, italic, or underlined. Text block is the primary control for displaying read-only text in apps.
