Page view counter
How to set 100% width / height? Subscribe to this thread
Last post 06-12-2008 10:57 PM by Allen Chen – MSFT. 3 replies.
Sort Posts:
06-11-2008 6:22 AM
How to set 100% width / height?

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%"/>

<Button width="73"/>

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

Skute

Loading...
Joined on 05-27-2006
UK
Posts 156
06-11-2008 6:47 AM
Marked as Answer
Re: How to set 100% width / height?

If you add that into the Grid which is as the size of the Page

UIElement will be automatic set the be 100%

Regards,
SteveWong (HongKong)
Please mark post as answer if they help you

Client App Dev

SteveWong

Loading...
Joined on 03-27-2008
Hong Kong
Posts 1,220
06-11-2008 7:10 AM
Re: Re: How to set 100% width / height?

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, 

Skute

Loading...
Joined on 05-27-2006
UK
Posts 156
06-12-2008 10:57 PM
Marked as Answer
Re: Re: How to set 100% width / height?

Hi:

  It's specific to Grid control.

Regards

Sincerely,
Allen Chen
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Allen Chen – MSFT

Loading...
Joined on 03-16-2007
Posts 1,761
Microsoft Communities