Skip to main content
Home Forums Silverlight Programming Programming with .NET - General How to set 100% width / height?
3 replies. Latest Post by Allen Chen – MSFT on June 12, 2008.
(0)
Skute
Member
222 points
156 Posts
06-11-2008 6:22 AM |
Hi, in Flex you can set the width / height of a component to be 100%, e.g.
<TextBox width="100%" height="100%">
How can I do this in Silverlight?
Also, Flex has a spacer component that you can add into auto arranging components. E.g. I would like a stack panel like the following:
<StackPanel>
<Label width="Auto"/>
<Button width="73"/>
<Spacer width="100%"/>
</StackPanel>
The result of this is a label on the left, with a button next to it, and then the remaining button on the right hand side.
Any help appreciated,
Thanks
SteveWong
Contributor
6323 points
1,281 Posts
06-11-2008 6:47 AM |
If you add that into the Grid which is as the size of the Page
UIElement will be automatic set the be 100%
06-11-2008 7:10 AM |
So a UIElement will automatically fill the entire space of a Grid control? Is that specific to grid controls, or will that happen with all controls?
Thanks,
Allen Ch...
Star
13662 points
1,780 Posts
06-12-2008 10:57 PM |
Hi:
It's specific to Grid control.
Regards