---
title: "Change button color when disabled"  
description: "Change button color when disabled"  
author: "Anonymous User"  
published: 2014-03-06  
updated: 2014-03-06  
canonical: https://www.mindstick.com/forum/1984/change-button-color-when-disabled  
category: "asp.net mvc"  
tags: ["asp.net mvc"]  
reading_time: 1 minute  

---

# Change button color when disabled

I use the following [button](https://www.mindstick.com/articles/63/how-to-add-button-in-datagridview-in-csharp-dot-net) and when isDisabled is [true](https://yourviews.mindstick.com/view/81326/boycott-chinese-products-dream-will-come-true) the button is [transparent](https://www.mindstick.com/forum/1784/wpf-webbrowser-on-transparent-window) (here its always true for the example but in my [program](https://www.mindstick.com/blog/12337/scaling-up-your-mentorship-program) its bound to command...) what I want is that when the button is disabled the [color](https://www.mindstick.com/articles/77/how-to-split-form-background-color-in-c-sharp) remain the same just ligther, how can I achive that?

<Button

Width="100"

Height="25"

[Background](https://www.mindstick.com/articles/65/how-to-change-background-color-of-tab-control-in-c-sharp)="#f0ab00"

[Content](https://www.mindstick.com/articles/13019/get-the-best-content-marketing-pricing-packages-for-your-brand)="Run"

FontSize="16"

Foreground="#ffffff"

IsDefault="True"

[Margin](https://answers.mindstick.com/qa/104990/what-is-a-margin-call)="10,0,20,0"

IsEnabled="false" />

## Replies

### Reply by Pravesh Singh

Hi Ben,\
Try this:

```
<Style TargetType="{x:Type Button}">    <Setter Property="Foreground" Value="#ffffff"/>    <Setter Property="Background" Value="#f0ab00"/>           
<Style.Triggers>        <Trigger Property="IsEnabled" Value="false">            <Setter Property="Background" Value="#f0aa00"/>       
</Trigger>   
</Style.Triggers></Style>
```


---

Original Source: https://www.mindstick.com/forum/1984/change-button-color-when-disabled

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
