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条边都是一样的大小  
相关推荐
Scout-leaf3 天前
WPF新手村教程(三)—— 路由事件
c#·wpf
柒.梧.5 天前
基于SpringBoot+JWT 实现Token登录认证与登录人信息查询
wpf
十月南城8 天前
Flink实时计算心智模型——流、窗口、水位线、状态与Checkpoint的协作
大数据·flink·wpf
听麟11 天前
HarmonyOS 6.0+ 跨端会议助手APP开发实战:多设备接续与智能纪要全流程落地
分布式·深度学习·华为·区块链·wpf·harmonyos
@hdd11 天前
Kubernetes 可观测性:Prometheus 监控、日志采集与告警
云原生·kubernetes·wpf·prometheus
zls36536511 天前
C# WPF canvas中绘制缺陷分布map
开发语言·c#·wpf
专注VB编程开发20年11 天前
c#Redis扣款锁的设计,多用户,多台电脑操作
wpf
闲人编程12 天前
定时任务与周期性调度
分布式·python·wpf·调度·cron·定时人物·周期性
zls36536512 天前
C# WPF canvas中绘制缺陷分布map并实现缩放
开发语言·c#·wpf
数据知道13 天前
PostgreSQL:Citus 分布式拓展,水平分片,支持海量数据与高并发
分布式·postgresql·wpf