摘要: Gird布局容器的功能比较强大,能够使用其他布局容器实现的功能,Grid也能实现,Gird是网格式布局,创建Grid面板的布局需要两个步骤:1.创建希望的行和列的数量。2为每个包含的控件指定适当的行和列。下面试XAML 代码: <Grid ShowGridLines="True"> <Grid.RowDefinitions> <RowDefinition></RowDefinition> <RowDefinition></RowDefinition> </Grid.RowDefinitions&g 阅读全文
posted @ 2011-12-27 23:54 William Jiang 阅读(662) 评论(0) 推荐(0)
摘要: DockPanel StackPanel WrapPanel这些面板很少单独使用,对窗口的控件进行布局很多时候都是嵌套使用的。下面是DockPanel 和StackPanel的嵌套使用 ,创建一个对话框。 <DockPanel LastChildFill="True"> <StackPanel DockPanel.Dock="Bottom" HorizontalAlignment="Right" Orientation="Horizontal"> <Button Margin=&quo 阅读全文
posted @ 2011-12-27 22:40 William Jiang 阅读(703) 评论(0) 推荐(0)
摘要: DockPanel 面板是根据外边缘进行控件的拉伸,DockPanel的LastChildFill属性设置为True 时,最后一个添加的控件将占满剩余空间。 <DockPanel LastChildFill="True"> <Button DockPanel.Dock="Top">Top Button</Button> <Button DockPanel.Dock="Bottom">Bottom Button</Button> <Button DockPanel.Doc 阅读全文
posted @ 2011-12-27 22:09 William Jiang 阅读(561) 评论(0) 推荐(0)
摘要: StackPanel 面板是简单的布局容器。该面板简单地在单行或单列中以堆栈的形式放置其中的子元素,默认情况StackPanel是自上而下排列元素,标签和按钮的大小刚好足够适合它们内部包含的文本。,也可以设置Orientantion 属性,使StackPanel面板水平排列元素 例如 <Window x:Class="Project03_01StackPanel.MainWindow" ... 阅读全文
posted @ 2011-12-27 00:42 William Jiang 阅读(808) 评论(0) 推荐(0)