SelectionHighlightColor property

PasswordBox.SelectionHighlightColor property

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


public SolidColorBrush SelectionHighlightColor { get; set; }

<PasswordBox SelectionHighlightColor="{StaticResource resourceName}"/>

<PasswordBox SelectionHighlightColor="colorString"/>

XAML Values


The 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.


The 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

Type: SolidColorBrush

The brush used to highlight the selected text. The default is a null brush from a pure code perspective, but the default control template for PasswordBox applies a theme resource brush for this in a runtime instance of a PasswordBox control.


The control template 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. For more info, see XAML theme resources or PasswordBox styles and templates.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0


Windows::UI::Xaml::Controls [C++]



Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]


Windows::UI::Xaml::Controls [C++]



See also

Use brushes



© 2016 Microsoft