Java教程

WPF GridSpliter 用法

本文主要是介绍WPF GridSpliter 用法,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

 

 

<Window x:Class="WpfDemo.LAY_OUT_GRID"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="LAY_OUT_GRID" Height="300" Width="300" MinWidth="200" MinHeight="300" MaxWidth="400" MaxHeight="600">
    <Grid ShowGridLines="False">
        <Grid.RowDefinitions>
            <RowDefinition Height="25"></RowDefinition>
            <RowDefinition></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="150"></ColumnDefinition>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
            <ColumnDefinition></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <TextBox Grid.ColumnSpan="3"></TextBox>
        <TextBox Grid.Row="1" TextWrapping="Wrap">ShowsPreview true  鼠标拖动放开时才生效,false 鼠标移动内容就变化</TextBox>
        <GridSplitter Grid.Row="1" Grid.Column="1" 
                      HorizontalAlignment="Center" 
                      Width="5" 
                      Background="Gray"
                      ShowsPreview="True"
                      ></GridSplitter>
        <TextBox Grid.Row="1" Grid.Column="2" TextWrapping="Wrap">HorizontalAlignment="Center" 不设置 左右可能拉不动  </TextBox>
    </Grid>
    <!--<WrapPanel Orientation="Vertical">
        <Button Content="OK" Height="50" Width="50"></Button>
        <Button Content="OK" Height="50" Width="50"></Button>
        <Button Content="OK" Height="50" Width="50"></Button>
        <Button Content="OK" Height="50" Width="50"></Button>
        <Button Content="OK" Height="50" Width="50"></Button>
        <Button Content="OK" Height="50" Width="50"></Button>
    </WrapPanel>-->
</Window>

  

这篇关于WPF GridSpliter 用法的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!