如何在WPF中绘制垂直线 [英] How to draw a vertical line in WPF

查看:107
本文介绍了如何在WPF中绘制垂直线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用< separator>单独的水平窗口。

现在我想创建一个垂直分隔线。

所以请建议我。

I'm using <separator> to separate horizontal window.
now i want to create a vertical separation line.
so please suggest me.

推荐答案

您可能会寻找这样的网格分割器吗?

You might look for a grid splitter like this?
<Window x:Class="WpfApplication9.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition></ColumnDefinition>
            <ColumnDefinition></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Button Content="Button" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click"/>
        <Button Content="Button" HorizontalAlignment="Left" Margin="10,37,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click_1"/>
        <GridSplitter Width="5" IsEnabled="False"></GridSplitter>
    </Grid>
</Window>



如果IsEnabled设置为true,您可以移动网格分割器并更改网格的比例





有关网格分割器的详细信息,请访问:

http://wpf.2000things.com/tag/gridsplitter/


If IsEnabled is set to "true" you can move the grid splitter and change
the proportions of the grid.

Detailed information on grid splitter can be found here:
http://wpf.2000things.com/tag/gridsplitter/


这篇关于如何在WPF中绘制垂直线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆