Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 2.09 KB

richtextblock_selectionhighlightcolor.md

File metadata and controls

39 lines (27 loc) · 2.09 KB
-api-id -api-type
P:Windows.UI.Xaml.Controls.RichTextBlock.SelectionHighlightColor
winrt property

Windows.UI.Xaml.Controls.RichTextBlock.SelectionHighlightColor

-description

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

-xaml-syntax

<RichTextBlock SelectionHighlightColor="{StaticResource resourceName}"/>
- or -
<RichTextBlock 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 default text styles for [RichTextBlock](richtextblock.md) content apply a theme resource brush for this in a runtime instance of a [RichTextBlock](richtextblock.md) control.

-remarks

A default text style sets the default selection highlight color to the system resource TextSelectionHighlightColorThemeBrush. To change the selection highlight color for all editable text controls in your app, you can override the TextSelectionHighlightColorThemeBrush system resource in App.xaml. This will affect PasswordBox, TextBox, and RichEditBox controls as well as RichTextBlock content. For more info, see XAML theme resources.

-examples

-see-also

Use brushes