Click here to Skip to main content
16,020,201 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi
I want to have some of my control fill the entire height and width of it's parent control.

For example:
Lets say I have a Grid and in it I have a Border control. The Grid's height and width is both set to 500. Now I want my border to fill this area.

In ASP.NET you would just say the width and height is 100%, but SilverLight does not support this.

How can I get the same effect in Silverlight?

I tried Googling and I'm not really finding what I'm looking for... maybe I'm searching for the wrong key words or something :-O

Any help would be appreciated.
Thanks
Posted

1 solution

Try this:
<Border HorizontalAlignment="Strech" VerticalAlignment="Strech" ... />
 
Share this answer
 
v2
Comments
NeCroFire 14-Dec-10 4:26am    
So simple and yet I didn't even think to check what other properties might be available in HorizontalAlignment.
Thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900