AwkwardCoder
AwkwardCoder

Reputation: 25651

Selected text color in WPF

Is it possible to set the selected text color for control like TextBox, ComboBox simply or do I have to setup a style trigger to change the selected text background.

I have a set of styles applied to the controls, but one of the things that isn't styled is the selected text, it's defaulted to a pale blue. I've tried setting some of the properties of the SystemColors class but this had no affect.

<SolidColorBrush x:Key="{x:Static SystemColors.HighlightColor}"
                 Color="Red" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightColorKey}"
                 Color="Red" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}"
                 Color="Orange" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrush}"
                 Color="Orange" />

Upvotes: 3

Views: 1240

Answers (1)

Chris W.
Chris W.

Reputation: 23290

It sounds like you're looking for the TextBoxBase.SelectionBrush property

Upvotes: 2

Related Questions