的Silverlight格(面板)2栏50%/ 50% [英] Silverlight grid (panel) 2 columns 50%/50%

查看:141
本文介绍了的Silverlight格(面板)2栏50%/ 50%的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我想一个Silverlight网格布局面板。
宽度应为100%。
应该有2列,无论采取50%。
在列应该是采取列单元格的100%按钮..


不知怎的,我搞砸了所有的时间,并不能找到一个方法来做到这一点。
GridPanel中不是必须的.​​.....的StackPanel或任何细太..
还有一件事..网格包含在一个StackPanel中
如果实在不行.. code是也没关系。

Hello I want a silverlight grid layout panel.
The width should be 100%.
There should be 2 columns that both take 50%.
In the columns there should be buttons that take 100% of the column cell..


Somehow I mess it up all the time and cannot find a way to do this.
Gridpanel is not a must... Stackpanel or whatever is fine too..
One more thing.. the grid is contained in a stackpanel
If nothing works.. code is fine too..

-------Stackpanel--------
|---griddpanel-100%-----|
||50%       |50%       ||
||Button100%|Button100%||
|-----------------------|
-------------------------

感谢您的帮助......

Thanks for any help...

推荐答案

这应该这样做的:

<StackPanel>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="50*" />
            <ColumnDefinition Width="50*" />
        </Grid.ColumnDefinitions>
        <Button Grid.Column="0">B1</Button>
        <Button Grid.Column="1">B2</Button>                
    </Grid>
</StackPanel>

这篇关于的Silverlight格(面板)2栏50%/ 50%的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆