Articles in this section
Category / Section

How to set the focused background and foreground color in WPF UpDown?

1 min read

 

 

You can change the background and foreground of WPF UpDown control by using FocusedBackground and FocusedForeground property. This feature can be enabled by setting EnableFocusedColors property to true.

XAML:

//Code Explains How to set the FocusBackground and FocusForeground color in UpDown
<Grid>
     <syncfusion:UpDown Name="UpDown" Width="150" Height="70" EnableFocusedColors="True" FocusedBackground="Yellow" FocusedForeground="Red"></syncfusion:UpDown>
</Grid>

C#

//Code Explains How to set the FocusBackground and FocusForeground color in UpDown
namespace UpDown
{
   public partial class MainWindow : Window
   {
      public MainWindow()
      {
         InitializeComponent();
         UpDown.EnableFocusedColors = true;
         UpDown.FocusedBackground = Brushes.Yellow;
         UpDown.FocusedForeground = Brushes.Red;
      }
   }
}        

FocusBackground

           WPF UpDown displays background when Focused

    FocusForeground

          WPF UpDown displays foreground when Focused

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