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.
The following screenshot displays the foreground color when you assign the negative value.