WPF(Grid与布局)
<window x:class="testofgridlayout.mainwindow"
xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"
title="留言板" height="240" width="400"
minheight="200" maxheight="300" minwidth="350" maxwidth="600">
<grid margin="10">
<grid.columndefinitions>
<columndefinition width="auto" minwidth="120"/>
<columndefinition width="*"/>
<columndefinition width="80"/>
<columndefinition width="4" />
<columndefinition width="80"/>
</grid.columndefinitions>
<grid.rowdefinitions>
<rowdefinition height="25"/>
<rowdefinition height="4" />
<rowdefinition height="*" />
<rowdefinition height="4" />
<rowdefinition height="25"/>
</grid.rowdefinitions>
<textblock text="请选择您的部门并留言: " grid.column="0" grid.row="0" verticalalignment="center" />
<combobox grid.column="1" grid.row="0" grid.columnspan="4" borderbrush="black" />
<textbox grid.column="0" grid.row="2" grid.columnspan="5" borderbrush="black" />
<button content="提交" grid.column="2" grid.row="4" />
<button content="清除" grid.column="5" grid.row="4" />
</grid>
</window>
<window x:class="testofgridlayout.mainwindow"
xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"
title="留言板" height="240" width="400"
minheight="200" maxheight="300" minwidth="350" maxwidth="600">
<grid margin="10">
<grid.columndefinitions>
<columndefinition width="auto" minwidth="120"/>
<columndefinition width="*"/>
<columndefinition width="80"/>
<columndefinition width="4" />
<columndefinition width="80"/>
</grid.columndefinitions>
<grid.rowdefinitions>
<rowdefinition height="25"/>
<rowdefinition height="4" />
<rowdefinition height="*" />
<rowdefinition height="4" />
<rowdefinition height="25"/>
</grid.rowdefinitions>
<textblock text="请选择您的部门并留言: " grid.column="0" grid.row="0" verticalalignment="center" />
<combobox grid.column="1" grid.row="0" grid.columnspan="4" borderbrush="black" />
<textbox grid.column="0" grid.row="2" grid.columnspan="5" borderbrush="black" />
<button content="提交" grid.column="2" grid.row="4" />
<button content="清除" grid.column="5" grid.row="4" />
</grid>
</window>
[html] view plaincopyprint?
<window x:class="testofgrid.mainwindow"
xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"
title="mainwindow" height="350" width="525" loaded="window_loaded">
<grid x:name="gridmain">
<grid.columndefinitions >
<columndefinition />
<columndefinition />
<columndefinition />
</grid.columndefinitions>
<grid.rowdefinitions >
<rowdefinition height="30px"/>
<rowdefinition height="30"/>
<rowdefinition height="0.5in"/>
<rowdefinition height="1cm"/>
<rowdefinition height="30pt"/>
</grid.rowdefinitions>
</grid>
</window>
<window x:class="testofgrid.mainwindow"
xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"
title="mainwindow" height="350" width="525" loaded="window_loaded">
<grid x:name="gridmain">
<grid.columndefinitions >
<columndefinition />
<columndefinition />
<columndefinition />
</grid.columndefinitions>
<grid.rowdefinitions >
<rowdefinition height="30px"/>
<rowdefinition height="30"/>
<rowdefinition height="0.5in"/>
<rowdefinition height="1cm"/>
<rowdefinition height="30pt"/>
</grid.rowdefinitions>
</grid>
</window>
上一篇: 炒面能放火锅底料吗?火锅底料可以炒面吗
下一篇: SpringBlade微服务开发平台