Articles in this section
Category / Section

How to set the foreground color in WPF DoubleTextBox ?

1 min read

You can set the foreground color for positive and negative values by using PositiveForeground, NegativeForeground properties in WPF DoubleTextBox. The negative value color will be applied when the ApplyNegativeForeground property is true.

XAML

<syncfusion:DoubleTextBox Name="doubletextbox"  Value="12345" PositiveForeground="Green" ApplyNegativeForeground="True" NegativeForeground="Blue"  />    

 

C#

doubletextbox.Value = 12345;
doubletextbox.ApplyNegativeForeground = true;
doubletextbox.PositiveForeground =new SolidColorBrush(Colors.Green);
doubletextbox.NegativeForeground =new SolidColorBrush(Colors.Blue);

The following screenshot displays the foreground color when you assign the positive value.

Changing positive value color in WPF DoubleTextBox

The following screenshot displays the foreground color when you assign the negative value.

Changing negative value color in WPF DoubleTextBox

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied