WPF中简单Grid容器控件实例

网上找了不好半球WPF的实例,国内没有多少,都是些入门,学习了几天,感觉这WPF真够强大。和WINFORM根本就是一个天上一个地下。

今天我用Grid做了一个小小例子,大家可以看看,我也是初学WPF没有多长时间,希望高手多多指教。谢谢

<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="浏览器" Height="240" Width="400">
    <Grid Margin="10">
     <Grid.ColumnDefinitions>
         <ColumnDefinition Width="78"></ColumnDefinition>
            <ColumnDefinition Width="45" />
            <ColumnDefinition Width="*"></ColumnDefinition>
         <ColumnDefinition Width="80"></ColumnDefinition>
         <ColumnDefinition Width="4"></ColumnDefinition>
         <ColumnDefinition Width="80"></ColumnDefinition>
     </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="25"></RowDefinition>
            <RowDefinition Height="4"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="4"></RowDefinition>
            <RowDefinition Height="25"></RowDefinition>
        </Grid.RowDefinitions>
        <TextBlock Text="请选择您的部门并留言:" VerticalAlignment="Center" Grid.ColumnSpan="2" Margin="0,5"></TextBlock>
        <ComboBox Grid.Column="2" Grid.ColumnSpan="4"></ComboBox>
        <TextBox Grid.Column="2" Grid.ColumnSpan="4" Grid.Row="2" BorderBrush="BurlyWood" />
        <Button Content="提交" Grid.Column="3" Grid.Row="4" />
        <Button Content="清除" Grid.Column="5" Grid.Row="4" />
    </Grid>
</Window>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值