zoukankan      html  css  js  c++  java
  • Button虚线边框

    <Window.Resources>
            <Style TargetType="Button">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <Grid>
                                <Border Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" BorderThickness="1">
                                    <Border.BorderBrush>
                                        <!--MappingMode:1.Absolute,StartPoint和EndPoint的值是按照Border的实际大小进行坐标设置
                                        2.RelativeToBoundingBox,StartPoint和EndPoint的值按照0,0和0,1进行设置
                                        -->
                                        <LinearGradientBrush StartPoint="0,5" EndPoint="5,0" SpreadMethod="Repeat" MappingMode="Absolute">
                                            <GradientStop Color="Red" Offset="0" />
                                            <GradientStop Color="Transparent" Offset="0.5" />
                                            <GradientStop Color="Red" Offset="1" />
                                        </LinearGradientBrush>
                                    </Border.BorderBrush>
                                </Border>
    <!--此方法也能显示文字   <ContentPresenter Content="{TemplateBinding Content}" VerticalAlignment="Center" HorizontalAlignment="Center" />-->
                                <TextBlock Text="{TemplateBinding Content}" VerticalAlignment="Center" HorizontalAlignment="Center" />
                            </Grid>                        
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </Window.Resources>
        <Grid Name="grdRoot">
            <Button Name="btnClick" Content="Click" Width="72" Height="24"  />                    
        </Grid>
  • 相关阅读:
    JVM体系结构和工作方式
    ClassLoader工作机制
    Javac编译原理
    类与类之间的几种关系
    一周总结汇总_2016-09-04
    一周规划汇总_2016-09-04
    Java基础知识笔记(一:修饰词、向量、哈希表)
    控制反转IoC简介
    DBCP连接池简介
    Struts与Struts2的区别
  • 原文地址:https://www.cnblogs.com/kelei12399/p/2598911.html
Copyright © 2011-2022 走看看