zoukankan      html  css  js  c++  java
  • Button 样式设置

     1  <Style x:Key="ControlBtnStyle"  TargetType="{x:Type Button}">
     2             <Setter Property="Template">
     3                 <Setter.Value>
     4                     <ControlTemplate  TargetType="{x:Type Button}">
     5                         <Border x:Name="border"  BorderThickness="1" BorderBrush="Black" CornerRadius="0.5" 
     6                             HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Padding="{TemplateBinding Padding}"
     7                             Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Background="DodgerBlue">
     8                             <Label x:Name="lbContent" Content="{TemplateBinding Content}" Background="Transparent" Height="{TemplateBinding Height}"
     9                                VerticalAlignment="Center" HorizontalAlignment="Center" FontFamily="宋体" FontSize="20" Foreground="White"/>
    10                         </Border>
    11                         <ControlTemplate.Triggers>
    12                             <Trigger Property="IsMouseOver" Value="True">
    13                                 <Setter Property="Background" TargetName="border" Value="{DynamicResource window_Button_MouseOver}"/>
    14                                 <Setter Property="BorderThickness" TargetName="border" Value="2"/>
    15                                 <Setter Property="FontSize" TargetName="lbContent" Value="22"/>
    16                                 <Setter Property="Foreground" TargetName="lbContent" Value="Orange"/>
    17                             </Trigger>
    18                         </ControlTemplate.Triggers>
    19                     </ControlTemplate>
    20                 </Setter.Value>
    21             </Setter>
    22         </Style>
  • 相关阅读:
    225. Implement Stack using Queues
    150. Evaluate Reverse Polish Notation
    159 Longest Substring with At Most Two Distinct Characters
    142. Linked List Cycle II
    打印沙漏 (20 分)
    人见人爱A-B
    人见人爱A+B
    杨辉三角
    进制转换
    汉字统计
  • 原文地址:https://www.cnblogs.com/wynblogscc/p/13986228.html
Copyright © 2011-2022 走看看