wpf – 在Windows经典主题中更改禁用列表框的背景颜色

我正在开发一个必须使用Windows经典主题运行的WPF应用程序.该应用程序创建一个包含ListBox的对话框.显示对话框时,在接受任何输入之前必须禁用1秒.我用一个样式触发器来完成它,它的工作原理.但是,ListBox在禁用时显示白色背景,我似乎无法摆脱它.使用aero主题时,以下样式资源可修复此问题:
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent"/>

但是在使用Windows经典主题时,会再次出现白色背景.我怎样才能解决经典主题的情况???

经过进一步研究,我发现Windows Classic主题使用WindowBrushKey而不是ControlBrushKey.因此,这解决了Aero和Classic主题的问题:
<Style targettype="{x:Type ListBox}">
    <Style.Resources>
        <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent"/>
        <SolidColorBrush x:Key="{x:Static SystemColors.WindowBrushKey}" Color="Transparent"/>
    </Style.Resources>

相关文章

Windows2012R2备用域控搭建 前置操作 域控主域控的主dns:自...
主域控角色迁移和夺取(转载) 转载自:http://yupeizhi.blo...
Windows2012R2 NTP时间同步 Windows2012R2里没有了internet时...
Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...