<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="直线段" Height="200" Width="300">
<Grid>
<Line X1="10" Y1="20" X2="260" Y2="20" Stroke="Red" StrokeThickness="5"/>
<Line X1="10" Y1="40" X2="260" Y2="40" StrokeDashArray="5" Stroke="Black" StrokeThickness="1"/>
<Line X1="10" Y1="60" X2="260" Y2="60" Stroke="Blue" StrokeEndLineCap
新建一个WPF应用程序项目,在画布上画出5种直线
![](https://img-home.csdnimg.cn/images/20240711042549.png)