Category / Section
How to change background color of up and down button in WPF UpDown?
1 min read
Background color of Up and Down button can be changed by getting them from the WPF UpDown control’s template. Up and Down buttons can retrieve from Template of UpDown control with names upbutton and downbutton respectively.
XAML
//Code Explains how to change Background color of Up and Down button for UpDown <Grid> <syncfusion:UpDown Name="UpDown1" Loaded="UpDown1_Loaded" MinWidth="100" Height="40" Width="100" Value="5000"/> </Grid>
C#:
//Code Explains how to change the Background color of Up and Down button for UpDown namespace UpDown1 { public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void UpDown1_Loaded(object sender, RoutedEventArgs e) { RepeatButton Up = UpDown1.Template.FindName("upbutton", UpDown1) as RepeatButton; RepeatButton Down = UpDown1.Template.FindName("downbutton", UpDown1) as RepeatButton; Up.Background = Brushes.Yellow; Down.Background = Brushes.YellowGreen; } } }