wpf 线条 居中
展开全部
把你的X1,X2 值设置为宽度的一半就可以了
<Window x:Class="EBSCA.EquipmentAdmin.EquipmentMapForm"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="EquipmentMapForm" Height="300" Width="300">
<Grid>
<Line StrokeThickness="100" X1="50" X2="50" Y1="0" Y2="100" HorizontalAlignment="Center" VerticalAlignment="Center" Stroke="#FFC31B1B" >
</Line>
</Grid>
</Window>
<Window x:Class="EBSCA.EquipmentAdmin.EquipmentMapForm"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="EquipmentMapForm" Height="300" Width="300">
<Grid>
<Line StrokeThickness="100" X1="50" X2="50" Y1="0" Y2="100" HorizontalAlignment="Center" VerticalAlignment="Center" Stroke="#FFC31B1B" >
</Line>
</Grid>
</Window>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询