wpf 可调大小的子窗口
这里介绍一个可以调节子窗口大小的例子:
<Window x:Class="EdiltPush.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 ShowGridLines="True"> <Grid.RowDefinitions> <RowDefinition MinHeight="0"></RowDefinition> <RowDefinition Height="auto"></RowDefinition> <RowDefinition MinHeight="0"></RowDefinition> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" MinWidth="30"></ColumnDefinition> <ColumnDefinition Width="auto" MinWidth="10"></ColumnDefinition> <ColumnDefinition Width="*" MinWidth="20"></ColumnDefinition> <ColumnDefinition Width="auto" MinWidth="10"></ColumnDefinition> <ColumnDefinition Width="*" MinWidth="10"></ColumnDefinition> </Grid.ColumnDefinitions> <TextBox Text="Hello world." Grid.Row="0" Grid.Column="0" Margin="3"></TextBox> <Button Content="button" Grid.Row="0" Grid.Column="2" Margin="3"></Button> <TextBox Text=" text box" Grid.Row="0" Grid.Column="4" Margin="3"></TextBox> <Button Content="button" Grid.Row="2" Grid.Column="0" Margin="3"></Button> <TextBox Text="This is a text box" Grid.Row="2" Grid.Column="2" Margin="3"></TextBox> <Button Content="button" Grid.Row="2" Grid.Column="4" Margin="3"></Button> <GridSplitter Grid.Column="1" Grid.RowSpan="3" Width="8" VerticalAlignment="Stretch" HorizontalAlignment="Center"></GridSplitter> <GridSplitter Grid.Column="3" Grid.RowSpan="3" Width="8" VerticalAlignment="Stretch" HorizontalAlignment="Center"></GridSplitter> <GridSplitter Grid.Row="1" Grid.ColumnSpan="5" Height="4" HorizontalAlignment="Stretch" VerticalAlignment="Center"></GridSplitter> </Grid> </Window>