WPF Border控件 基本使用

Border 基本使用

1单线效果

代码:

复制代码
<Border Grid.Row="0" BorderThickness="0,0,0,1" BorderBrush="Red" />

说明:

复制代码
BorderThickness="0,0,0,1" 可以分别设置四条边,顺序是:左 上 右 下
复制代码
2虚线效果

代码:

复制代码
<Border Grid.Row="0" BorderThickness="0,0,0,1" >
      <Border.BorderBrush>
          <VisualBrush>
              <VisualBrush.Visual>
                  <Rectangle StrokeDashArray="4 2" Stroke="Gray" StrokeThickness="1"
Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualWidth}"
Height="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualHeight}"/>
              </VisualBrush.Visual>
          </VisualBrush>
      </Border.BorderBrush>
  </Border>
复制代码
BorderThickness="1" 只设置一个值时表示4条边都是一样的大小  
相关推荐
Poetinthedusk16 小时前
WPF应用跟随桌面切换
开发语言·wpf
小北方城市网18 小时前
MongoDB 分布式存储与查询优化:从副本集到分片集群
java·spring boot·redis·分布式·wpf
听麟1 天前
HarmonyOS 6.0+ 智慧出行导航APP开发实战:离线地图与多设备位置协同落地
华为·wpf·harmonyos
笨蛋不要掉眼泪2 天前
Spring Boot + RedisTemplate 数据结构的基础操作
java·数据结构·spring boot·redis·wpf
LcVong3 天前
WPF MediaPlayer获取网络视频流当前帧并展示图片完整范例
网络·wpf
bugcome_com3 天前
WPF数据绑定入门:从传统事件到5种绑定模式
wpf
LateFrames3 天前
我用 WPF 做了一个 “苍蝇飞舞” 的屏保
ui·wpf
wuty0073 天前
完善基于WPF开发的标尺控件(含实例代码)
wpf·wpf标尺·支持横向竖向标尺·ruler
浩浩测试一下4 天前
洪水猛兽攻击 Ddos Dos cc Drdos floods区别
安全·web安全·网络安全·系统安全·wpf·可信计算技术·安全架构
无心水4 天前
分布式环境下定时任务与SELECT FOR UPDATE的陷阱与解决方案
分布式·后端·wpf·xxl-job·quartz·定时任务·selectforupdate