首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

WPF 兑现DataGrid行鼠标经过、点击时的背景、文字、行高等样式

2013-02-24 
WPF 实现DataGrid行鼠标经过、点击时的背景、文字、行高等样式直接上代码(不解释):DataGrid.RowStyle Styl

WPF 实现DataGrid行鼠标经过、点击时的背景、文字、行高等样式

直接上代码(不解释):
<DataGrid.RowStyle >
<Style TargetType="DataGridRow">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#FFF1FAFF"/>
<Setter Property="FontSize" Value=" 20"/>
<Setter Property="Height" Value="30"/>
<Setter Property="Foreground" Value="Blue"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.CellStyle >
<Style TargetType="DataGridCell">
<Style.Triggers >
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#FFF1FAFF"/>
<Setter Property="FontSize" Value=" 20"/>
<Setter Property="Height" Value="30"/>
<Setter Property="Foreground" Value="Blue"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>

热点排行