Category / Section
How to change zero value color in WPF DoubleTextBox?
1 min read
You can change a zero color for the value of WPF DoubleTextBox by setting the ZeroColor property and it will be applied when the ApplyZeroColor property is true, and the Value is zero. The default color of ZeroColor is Green.
XAML
<Grid> <syncfusion:DoubleTextBox Name="DoubleTextBox1" Width="150" Height="50" ApplyZeroColor="True" ZeroColor="Green" Value="0"></syncfusion:DoubleTextBox> </Grid>
C#
//Code Explains how to set ZeroColor in DoubleTextBox namespace DoubleTxtbor_color { public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); DoubleTextBox1.Value = 0; DoubleTextBox1.ApplyZeroColor = true; DoubleTextBox1.ZeroColor = Brushes.Orange; } } }