首页 > Windows开发 > 详细

WPF Button IsMouseOver Background

时间:2018-09-23 12:18:52      阅读:291      评论:0      收藏:0      [点我收藏+]

标签:get   nes   tps   target   cal   win   targe   ont   quest   

https://stackoverflow.com/questions/17259280/how-do-you-change-background-for-a-button-mouseover-in-wpf

<Window.Resources>
<Style TargetType="{x:Type Button}">
<Setter Property="Background" Value="Red"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}" BorderBrush="Black" BorderThickness="1">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Yellow"/>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>

 

WPF Button IsMouseOver Background

标签:get   nes   tps   target   cal   win   targe   ont   quest   

原文:https://www.cnblogs.com/Fred1987/p/9692219.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 bubuko.com 版权所有 鲁ICP备09046678号-4
打开技术之扣,分享程序人生!
             

鲁公网安备 37021202000002号