当前位置: 移动技术网 > IT编程>开发语言>.net > WPF(Grid与布局)

WPF(Grid与布局)

2018年10月25日  | 移动技术网IT编程  | 我要评论

浮山县政务网,米内斯塔的残卷,俄朝边境疑现大军

<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>

 

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网