失败案例

<Border CornerRadius="3" Width="100" Height="100">
<StackPanel Background="Red"></StackPanel>
</Border>

换成下面就成功?为什么?

<Border CornerRadius="3" Background="Red" Width="100" Height="100">
<StackPanel ></StackPanel>
</Border>

1设备Button圆角

<Button x:Name="but1" Content="软件介绍" HorizontalAlignment="Left" Margin="126,356,0,0" VerticalAlignment="Top" Width="128" Click="Button_Click" FontSize="20" Height="35" >
  <Button.Template>
    <ControlTemplate TargetType="{x:Type Button}">
      <Border BorderBrush="{TemplateBinding Control.BorderBrush}" BorderThickness="1" CornerRadius="10">
        <Border.Background>#FF8EB4D4</Border.Background>
        <ContentPresenter Content="{TemplateBinding ContentControl.Content}" HorizontalAlignment="Center" VerticalAlignment="Center" />
      </Border>
    </ControlTemplate>
  </Button.Template>
</Button>

2 设置TextBox圆角

<TextBox HorizontalAlignment="Left" Height="24" Margin="43,192,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="98">
<TextBox.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="8"/>
<Setter Property="BorderBrush" Value="#c1d0dc"/>
</Style>
</TextBox.Resources>
</TextBox>

3PasswordBox设置圆角

<PasswordBox x:Name="t2" HorizontalAlignment="Left" Margin="183,150,0,0" VerticalAlignment="Top" Width="114" Height="26" BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" FontSize="18" Password="
">
<PasswordBox.Resources>
<Style TargetType="PasswordBox">
<Setter Property="PasswordChar" Value="●"/>
<Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="Padding" Value="1"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="AllowDrop" Value="true"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="PasswordBox">
<Border CornerRadius="8" x:Name="Bd" Background="White" BorderBrush="#c1d0dc" BorderThickness="1" OpacityMask="{x:Null}">
<ScrollViewer SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" x:Name="PART_ContentHost" Template="{DynamicResource ScrollViewerControlTemplate1}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</PasswordBox.Resources>
</PasswordBox>

最新文章

  1. Rectangle Area
  2. NopCommerce Url分析
  3. Design and Analysis of Algorithms_Introduction
  4. 测试bug级别定义
  5. 在数据库查询时解决大量in 关键字的方法
  6. 清空系统日志shell scripts——自学笔记
  7. struts2 标签的使用之一 s:if
  8. css布局模型之绝对定位与相对定位
  9. ASP.NET MVC- VIEW Creating Custom HTML Helpers Part 2
  10. QT开发pjsip的VOIP,A8平台运行
  11. IO流基础
  12. Servlet(一)基础总结
  13. IdentityServer4 禁用 Consent screen page(权限确认页面)
  14. 学习sharding-jdbc 分库分表扩展框架
  15. Python多版本共存(生产环境)
  16. mac 电脑进入root用户
  17. 实现 js 数据类型的判断函数type
  18. [Canvas]空战游戏 已经可以玩了 1.13Playable
  19. Creating a Hadoop-2.x project in Eclipse
  20. 图解中序遍历线索化二叉树,中序线索二叉树遍历,C\C++描述

热门文章

  1. HTML5 + canvas 汽车赛道,飙车游戏(附源码)
  2. 多重背包问题 II
  3. 学习Java Day21
  4. Spring IOC官方文档学习笔记(十一)之使用JSR 330标准注解
  5. quasar打包时:Module not found: Can&#39;t resolve imported dependency &quot;dayjs/plugin/customParseFormat&quot;
  6. 挖矿僵尸网络蠕虫病毒kdevtmpfsi处理过程
  7. 关于vux-ui框架的scroller组件所踩的坑
  8. CF1141F2 Same Sum Blocks (Hard)
  9. 找素数(java)
  10. 吐血整理!2万字Java基础面试题(带答案)请收好!