在silverlight中按下按钮突出显示

在silverlight中按下按钮突出显示,第1张

概述我有一个按钮,我添加一个图像作为其背景,但当我按下按钮时,我在按钮的背景上得到一个正方形(突出显示).我怎么能删除这个? <Button VerticalAlignment="Top" HorizontalAlignment="Left" BorderBrush="Transparent" Click="FirstCubeSelected" x:Name="cube1Button" Paddi 我有一个按钮,我添加一个图像作为其背景,但当我按下按钮时,我在按钮的背景上得到一个正方形(突出显示).我怎么能删除这个?

<button VerticalAlignment="top" HorizontalAlignment="left" borderBrush="transparent" Click="FirstCubeSelected" x:name="cube1button"   padding="0"   margin="1,-1,0">                <Image x:name="buttonImage" Source="/images/cub2onbtn.png" WIDth="176" Height="176" />            </button>

我通常在表达式混合中执行此 *** 作,但我现在无法访问它

解决方法 您需要从按钮中删除按下的视觉样式:

<Style x:Key="buttonStyle1" targettype="button">        <Setter Property="Background" Value="transparent"/>        <Setter Property="borderBrush" Value="{StaticResource PhoneForegroundBrush}"/>        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>        <Setter Property="borderThickness" Value="{StaticResource PhoneborderThickness}"/>        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/>        <Setter Property="padding" Value="10,3,10,5"/>        <Setter Property="Template">            <Setter.Value>                <ControlTemplate targettype="button">                    <GrID Background="transparent">                        <visualstatemanager.VisualStateGroups>                            <VisualStateGroup x:name="CommonStates">                                <VisualState x:name="normal"/>                                <VisualState x:name="MouSEOver"/>                                <VisualState x:name="pressed"/>                                <VisualState x:name="Disabled">                                    <Storyboard>                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.Targetname="ContentContainer">                                            <discreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>                                        </ObjectAnimationUsingKeyFrames>                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="borderBrush" Storyboard.Targetname="buttonBackground">                                            <discreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>                                        </ObjectAnimationUsingKeyFrames>                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.Targetname="buttonBackground">                                            <discreteObjectKeyFrame KeyTime="0" Value="transparent"/>                                        </ObjectAnimationUsingKeyFrames>                                    </Storyboard>                                </VisualState>                            </VisualStateGroup>                        </visualstatemanager.VisualStateGroups>                        <border x:name="buttonBackground" borderBrush="{TemplateBinding borderBrush}" borderThickness="{TemplateBinding borderThickness}" Background="{TemplateBinding Background}" CornerRadius="0" margin="{StaticResource PhonetouchTargetoverhang}">                            <ContentControl x:name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" padding="{TemplateBinding padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>                        </border>                    </GrID>                </ControlTemplate>            </Setter.Value>        </Setter>    </Style>
总结

以上是内存溢出为你收集整理的在silverlight中按下按钮突出显示全部内容,希望文章能够帮你解决在silverlight中按下按钮突出显示所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/web/1003519.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-22
下一篇 2022-05-22

发表评论

登录后才能评论

评论列表(0条)

保存