Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 1.72 KB

textblock_selectionhighlightcolor.md

File metadata and controls

42 lines (28 loc) · 1.72 KB
-api-id -api-type
P:Microsoft.UI.Xaml.Controls.TextBlock.SelectionHighlightColor
winrt property

Microsoft.UI.Xaml.Controls.TextBlock.SelectionHighlightColor

-description

Gets or sets the brush used to highlight the selected text.

-xaml-syntax

<TextBlock SelectionHighlightColor="{StaticResource resourceName}"/>
- or -
<TextBlock SelectionHighlightColor="colorString"/>

-xaml-values

resourceName
resourceNameThe resource name (x:Key attribute value) of an existing XAML resource that defines a brush. This is the recommended way to specify Brush values in XAML if you have any intention of using the same colors or brushes in more than one part of your UI. See Remarks in Brush or ResourceDictionary and XAML resource references.
colorString
colorStringThe Color for a SolidColorBrush expressed as an attribute string. This can be a named color, an RGB value, or an ScRGB value. RGB or ScRGB may also specify alpha information. See the XAML Values section in Color.
## -property-value The brush used to highlight the selected text. The default is a null brush from a pure code perspective, but the system uses base text styles to supply a runtime value for apps (unless you specifically override that style). The practical default is a brush using the theme resource **TextSelectionHighlightThemeColor**.

-remarks

Important

If using a keyboard for text selection within a TextBlock, the user must first activate Caret Browsing (with the app in the foreground, press F7).

-examples

-see-also

XAML brushes