Change background color of disabled listbox in windows classic theme Change background color of disabled listbox in windows classic theme wpf wpf

Change background color of disabled listbox in windows classic theme


After further research, I discovered that the Windows Classic theme uses WindowBrushKey instead of ControlBrushKey. Therefore, this fixes the issue for both Aero and Classic themes:

<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>