I want to change color of combo box for diasbled state to more darker one. Please let me know how do achieve this using triggers or any other way. Thanks !!
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Change the color in a simple property trigger:
<Style TargetType="ComboBox">
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="Green"/>
</Trigger>
</Style.Triggers>
</Style>
回答2:
Try this:-
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
In my case I set DyanmicResource to SystemColors.GrayTextBrushKey
You can set according to your requirement Check this link out