Articles in this section
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;
        }
    }
}

 

                Changing Zero 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