RichTextBlock.SelectionHighlightColor 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.
Gets or sets the brush used to highlight the selected text.
public:
property SolidColorBrush ^ SelectionHighlightColor { SolidColorBrush ^ get(); void set(SolidColorBrush ^ value); };
SolidColorBrush SelectionHighlightColor();
void SelectionHighlightColor(SolidColorBrush value);
public SolidColorBrush SelectionHighlightColor { get; set; }
var solidColorBrush = richTextBlock.selectionHighlightColor;
richTextBlock.selectionHighlightColor = solidColorBrush;
Public Property SelectionHighlightColor As SolidColorBrush
<RichTextBlock SelectionHighlightColor="{StaticResource resourceName}"/>
- or -
<RichTextBlock SelectionHighlightColor="colorString"/>
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 content apply a theme resource brush for this in a runtime instance of a RichTextBlock control.
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.
Product | Versions |
---|---|
WinRT | Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |