gpt4 book ai didi

c# - 样式数据网格表 - 左上角

转载 作者:太空狗 更新时间:2023-10-29 22:33:51 27 4
gpt4 key购买 nike

我正在设计数据表的样式,但我不知道如何设计数据网格左上角的样式。就是这张图中的灰色区域:

enter image description here

你知道怎么做吗?

到目前为止,这是我的风格:

<Style TargetType="{x:Type DataGrid}">
<Setter Property="Margin" Value="5" />
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="White"/>
<GradientStop Color="AliceBlue" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="RowBackground">
<Setter.Value>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#BAF0FF"/>
<GradientStop Color="PowderBlue" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="AlternatingRowBackground">
<Setter.Value>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="White"/>
<GradientStop Color="AliceBlue" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="HorizontalGridLinesBrush" Value="LightGray" />
<Setter Property="VerticalGridLinesBrush" Value="LightGray" />
</Style>

最佳答案

从这里answer我能够创建正确设置按钮样式的代码:

<DataGrid>    
<DataGrid.Resources>
<Style TargetType="Button" x:Key="{ComponentResourceKey ResourceId=DataGridSelectAllButtonStyle, TypeInTargetAssembly={x:Type DataGrid}}">
<Setter Property="Background" Value="Black" />
</Style>
</DataGrid.Resources>
</DataGrid>

关于c# - 样式数据网格表 - 左上角,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8328328/

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