zoukankan      html  css  js  c++  java
  • WPF布局(6) WPF布局的应用

        <Grid Margin="3,3,10,3">
    <Grid.RowDefinitions>
    <RowDefinition Height="Auto"></RowDefinition>
    <RowDefinition Height="Auto"></RowDefinition>
    <RowDefinition Height="Auto"></RowDefinition>
    <RowDefinition Height="Auto"></RowDefinition>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto"></ColumnDefinition>
    <ColumnDefinition Width="*"></ColumnDefinition>
    <ColumnDefinition Width="Auto"></ColumnDefinition>
    </Grid.ColumnDefinitions>
    <Label Grid.Row="0" Grid.Column="0" Margin="3"
    VerticalAlignment
    ="Center">Home:</Label>
    <TextBox Grid.Row="0" Grid.Column="1" Margin="3"
    Height
    ="Auto" VerticalAlignment="Center"></TextBox>
    <Button Grid.Row="0" Grid.Column="2" Margin="3"
    Padding
    ="2">Browse</Button>
    <Label Grid.Row="1" Grid.Column="0" Margin="3"
    VerticalAlignment
    ="Center">Home:</Label>
    <TextBox Grid.Row="1" Grid.Column="1" Margin="3"
    Height
    ="Auto" VerticalAlignment="Center"></TextBox>
    <Button Grid.Row="1" Grid.Column="2" Margin="3"
    Padding
    ="2">Browse</Button>
    <Label Grid.Row="2" Grid.Column="0" Margin="3"
    VerticalAlignment
    ="Center">Home:</Label>
    <TextBox Grid.Row="2" Grid.Column="1" Margin="3"
    Height
    ="Auto" VerticalAlignment="Center"></TextBox>
    <Button Grid.Row="2" Grid.Column="2" Margin="3"
    Padding
    ="2">Browse</Button>
    <Label Grid.Row="3" Grid.Column="0" Margin="3"
    VerticalAlignment
    ="Center">Home:</Label>
    <TextBox Grid.Row="3" Grid.Column="1" Margin="3"
    Height
    ="Auto" VerticalAlignment="Center"></TextBox>
    <Button Grid.Row="3" Grid.Column="2" Margin="3"
    Padding
    ="2">Browse</Button>
    </Grid>

        <Grid>
    <Grid.RowDefinitions>
    <RowDefinition Height="*"></RowDefinition>
    <RowDefinition Height="Auto"></RowDefinition>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto"></ColumnDefinition>
    <ColumnDefinition Width="*"></ColumnDefinition>
    </Grid.ColumnDefinitions>
    <StackPanel Grid.Row="0" Grid.Column="0">
    <Button Name="cmdPrev" Margin="10,10,10,3">Prev</Button>
    <Button Name="cmdNext" Margin="10,3,10,3">Next</Button>
    <CheckBox Name="chkLongText" Margin="10,10,10,10" >Show Long Text</CheckBox>
    </StackPanel>
    <TextBox Grid.Row="0" Grid.Column="1" Margin="0,10,10,10" TextWrapping="WrapWithOverflow"
    Grid.RowSpan
    ="2">This is a test that demonstrates how buttons adapt themselves to fit
    the content they contain when they aren't explicitly sized.this behavior makes localization much easier.</TextBox>
    <Button Grid.Row="1" Grid.Column="0" Name="cmdClose" Margin="10,3,10,10">Close</Button>
    </Grid>



  • 相关阅读:
    【JAVA SE基础篇】49.文件字符流和字节数组流
    【JAVA SE基础篇】48.IO流四大抽象类介绍和字节流
    【JAVA SE基础篇】47.file类的方法
    【JAVA SE基础篇】46.IO流的介绍
    【HTML篇】4.HTML的内嵌标签、框架标签、表单
    【HTML篇】3.HTML的图片标签、超链接标签、表格标签
    【HTML篇】2.HTML的head标签和body标签
    【HTML篇】1.HTML的介绍、三大基石、标准文档结构
    【JAVA SE基础篇】45.迭代器、Collections工具类以及使用容器存储表格
    【JAVA SE基础篇】44.手工实现简易HashMap和HashSet
  • 原文地址:https://www.cnblogs.com/WilliamJiang/p/2308139.html
Copyright © 2011-2022 走看看