我的数据网格行选择颜色默认为深蓝色,当我将Windows 7主题更改为Windows经典主题时,它看起来太黑暗和丑陋。
我想将我的wpf应用程序中所有数据网格的行选择颜色设置为在Windows 7和classic上看起来更好的其他颜色。 (如果你知道什么颜色对两者都有好处的话)
答案 0 :(得分:3)
要在应用程序级别为选定的DataGridRow
/ DataGridCell
设置背景,您可以将以下样式添加到App.xaml
<Application ...>
<Application.Resources>
<Style TargetType="DataGridCell">
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="LightBlue"/>
</Trigger>
</Style.Triggers>
</Style>
</Application.Resources>
</Application>
至于使用哪种颜色,除了尝试一些颜色之外我没有任何好的提示,直到找到你喜欢的颜色:)