---
title: "How to change backcolor of button control dynamically"  
description: "How to change backcolor of button control dynamically"  
author: "Anonymous User"  
published: 2011-03-12  
updated: 2020-09-24  
canonical: https://www.mindstick.com/interview/401/how-to-change-backcolor-of-button-control-dynamically  
category: "wpf"  
tags: ["wpf"]  
reading_time: 1 minute  

---

# How to change backcolor of button control dynamically

System.Windows.Controls.Button b = new System.Windows.Controls.Button(); \
\
b.Content = "OK"; \
\
b.Background = System.Windows.Media.Brushes.Red;

## Answers

### Answer by Anonymous User

System.Windows.Controls.Button b = new System.Windows.Controls.Button(); \
\
b.Content = "OK"; \
\
b.Background = System.Windows.Media.Brushes.Red;


---

Original Source: https://www.mindstick.com/interview/401/how-to-change-backcolor-of-button-control-dynamically

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
