gpt4 book ai didi

c# - 使用 WPF 数据网格时如何更改列标题背景颜色

转载 作者:IT王子 更新时间:2023-10-29 04:15:52 25 4
gpt4 key购买 nike

如何在使用 WPF 数据网格时更改列标题的背景颜色?需要直接修改xaml?

最佳答案

使用带有针对 DataGridColumnHeader 的 setter 的样式:

<DataGrid>
<DataGrid.Resources>
<Style BasedOn="{StaticResource {x:Type DataGridColumnHeader}}" TargetType="{x:Type DataGridColumnHeader}">
<Setter Property="Background" Value="Blue" />
</Style>
</DataGrid.Resources>
</DataGrid>

关于c# - 使用 WPF 数据网格时如何更改列标题背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4486977/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com