Searching for a way to set the background color of a WPF control programmatically seemed like more of an adventure then it should have been; there are sure a lot of complicated ways to set a background color. Reluctant to believe that it was this complicated I kept searching until I found it.
txtStatus.Foreground = new SolidColorBrush(Colors.White);
txtStatus.Background = new SolidColorBrush(Colors.Red);
Tags:
wpf,
control
Categories:
WPF