清空WPF自带样式,以及透明按钮

  • 空样式按钮

<Style x:Key="EmptyButtonStyle" TargetType="Button">
            <Setter Property="Padding" Value="0"/>
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <ContentPresenter Content="{TemplateBinding Content}"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

    <Button Width="50" Height="50" HorizontalAlignment="Left" Margin="4,0,0,0" Style="{StaticResource EmptyButtonStyle}" >
              <Image Source="Styles/Images/KaraokeElibrary/button_left_normalmode.png"></Image>
     </Button>

 

  • 透明样式按钮

 

<Style x:Key="TransparentButtonStyle" TargetType="Button">
            <Setter Property="Padding" Value="0"/>
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Background="Transparent"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

 

posted @ 2012-09-11 17:12  静艳  阅读(1589)  评论(1编辑  收藏  举报