mot rer
mot rer

Reputation: 153

TextBox trigger for IsEnabled

I want to change my TextBox Background color while my control IsEnable = false:

<Style TargetType="{x:Type TextBox}">
    <Style.Triggers>
        <Trigger Property="IsEnabled" Value="false">
            <Setter Property="Background" Value="#00ffffff"/>
        </Trigger>
    </Style.Triggers>
</Style>

But it seems that this not effect at all and now my Backgroung color is transparent and my Watermark (i am using MahApps) is missing.

Upvotes: 1

Views: 1068

Answers (1)

Glen Thomas
Glen Thomas

Reputation: 10764

You have set the opacity part (first 2 digits) of the HEX colour to transparent (00).

<Setter Property="Background" Value="#ffffffff"/>

Upvotes: 1

Related Questions