C/S WPF (简介,案例,源码,截图)
布局
WPF布局简介:spa
wpf中若是不进行控件布局的设置,咱们作出的应用调整窗口大小之后不能随窗体的大小而变化。xml
WPF布局案例:blog
TextBox---随窗体的变化而变化,布局---两行两列
源码
源码:it
<Window x:Class="OscarSystemV2012.Views.CustomerSystem.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBox Grid.Row="0" Grid.Column="0" Background="Yellow"></TextBox>
<TextBox Grid.Row="0" Grid.Column="1" Background="Yellow"></TextBox>
<TextBoxGrid.Row="1" Grid.Column="0" Background="Yellow"></TextBox>
<TextBox Grid.Row="1" Grid.Column="1" Background="Yellow"></TextBox>
</Grid>
</Window>
io
截图:im