wpf button style IsMouseOver
Posted fred1987
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了wpf button style IsMouseOver相关的知识,希望对你有一定的参考价值。
<Style x:Key="workButtonStyle" TargetType="x:Type Button"> <Style.Triggers> <Trigger Property="IsMouseOver" Value="False"> <Setter Property="FontSize" Value="20"/> </Trigger> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="FontSize" Value="30"/> </Trigger> </Style.Triggers> </Style>
<Style x:Key="CloseButtonStyle" TargetType="x:Type Button"> <Style.Triggers> <Trigger Property="IsMouseOver" Value="False"> <Setter Property="Content"> <Setter.Value> <Image Source="/AT;component/Resource/Images/CloseTrue.jpg"/> </Setter.Value> </Setter> </Trigger> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Content"> <Setter.Value> <Image Source="/AT;component/Resource/Images/Close.jpg"/> </Setter.Value> </Setter> </Trigger> </Style.Triggers> </Style>
以上是关于wpf button style IsMouseOver的主要内容,如果未能解决你的问题,请参考以下文章
WPF QuickStart系列之样式和模板(Style and Template)