本文介绍了< wpf question>如何删除按钮发光效果和边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 大家好,有人可以用wpf按钮帮我吗 我想删除边框和按钮发光效果。 我的按钮有图像背景,它会改变时鼠标悬停但按钮发光。 这里是按钮代码,我正在使用visual studio 2010 < 按钮 Grid.Row = 1 高度 = 214 HorizontalAlignment = 左 Marg in = 92,10,0,0 名称 = Inv VerticalAlignment = Top 宽度 = 279 BorderBrush = {x:Null} 前景 = {x:Null } 点击 = Inv_Click Grid.RowSpan = 2 BorderThickness = 0 ClickMode = 按 可聚焦 = False > < Button.Style > < 样式 TargetType = {x:Type Button} > < Setter Property = 背景 > < Setter.Value > < ImageBrush ImageSource = / ManaData; component / Images / Inv.png / > < / Setter.Value > < / Setter > < Style.Triggers > < ; 触发器 属性 = IsMouseOver 值 = True > < Setter 属性 = 背景 > < Setter.Value > < ImageBrush ImageSource = /ManaData ;component/Images/Inv2.png / > < / Setter.Value > < / Setter > < / Trigger > < / Style.Triggers > < / Style > < / Button.Style > < / Button > 解决方案 你可以用sim ply将默认边框画笔覆盖到您自己的边框画笔 < style.triggers > < 触发器 property = IsMouseOver value = true > < setter property = BorderBrush value = {StaticResource ToYourBorder} > < / setter > < / trigger > < / style.triggers > Hello everyone, can someone help me with wpf buttonI want to remove the border and button glow effect.my button has an image background, it changes when the mouse hover but the button glows.here is the button code, I'm using visual studio 2010<Button Grid.Row="1" Height="214" HorizontalAlignment="Left" Margin="92,10,0,0" Name="Inv" VerticalAlignment="Top" Width="279" BorderBrush="{x:Null}" Foreground="{x:Null}" Click="Inv_Click" Grid.RowSpan="2" BorderThickness="0" ClickMode="Press" Focusable="False" > <Button.Style> <Style TargetType="{x:Type Button}"> <Setter Property="Background"> <Setter.Value> <ImageBrush ImageSource="/ManaData;component/Images/Inv.png"/> </Setter.Value> </Setter> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Background"> <Setter.Value> <ImageBrush ImageSource="/ManaData;component/Images/Inv2.png"/> </Setter.Value> </Setter> </Trigger> </Style.Triggers> </Style> </Button.Style> </Button> 解决方案 you can simply override the default border brush to your own border brush<style.triggers> <trigger property="IsMouseOver" value="true"> <setter property="BorderBrush" value="{StaticResource ToYourBorder}"></setter> </trigger> </style.triggers> 这篇关于< wpf question>如何删除按钮发光效果和边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-27 08:55