This project has moved. For the latest updates, please go here.

Change Highlight/Select Color of NumericUpDown

Jun 22, 2016 at 11:26 AM
Hello,
How can I change the Color of the selected value from a NumericUpDown(DoubleUpDown) Control?
Developer
Jun 22, 2016 at 12:32 PM
Hi,

I believe you are talking about the Background color when the mouse is selecting the numeric values, inside the DoubleUpDown.
For a TextBox, you would use :
SelectionBrush="Red"
For a DoubleUpDown, you can create your own DoubleUpDown, and set its TextBox's SelectionBrush :
 public class MyDoubleUpDown : DoubleUpDown
  {
    public override void OnApplyTemplate()
    {
      base.OnApplyTemplate();
      if( this.TextBox != null )
      {
        this.TextBox.SelectionBrush = Brushes.Red;
      }
    }
  }