开发者

Silverlight grid (panel) 2 columns 50%/50%

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


This should do it it:

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜