Change selected and unfocused Listbox style to not be grayed out

前端 未结 6 840
执念已碎
执念已碎 2020-12-03 01:27

I have a really simple WPF ListBox with SelectionMode set to Multiple.


When the ListBox loses

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-03 01:29

    A more complete solution would be to have the new brush refer to HighlightColor:

    
            
        
    
    

    This would ensure that it uses the same color and matches the system theme (even if the system theme changes during runtime, thanks to DynamicResource).

    By the way, it seems recent versions of WPF do not use "ControlBrush" for this anymore, but the more appropriate "InactiveSelectionHighlightBrush".

提交回复
热议问题