Skip to main content
Home Forums Silverlight Programming Silverlight Controls and Silverlight Toolkit Dynamic height of a control
2 replies. Latest Post by poulraider on March 18, 2008.
(0)
poulraider
Member
86 points
66 Posts
03-12-2008 8:56 PM |
Hello, wondering if theres away to change the size of the actuel silverlight control based on its content.
Reason beeing: I got a menu that i placed with absolute css values etc, useing transperent backgrounds and windowless etc it looks how i expect it to look. On the page you only see the top 29px as the height of the visible content, and i want to make some kind of dropdown rendered over the other content. This would also work. My problem is that the height of the control is 500 to make room for etc dropdown content, but you wont see this as its position with abolute and transperent backgrounds, only way you would notice it would be if you right click on the page below the menu(where dropdown content is going to show) you will get the silverlight menu(where you would expect to get the page rightclick menu)
So is it posible to change the height of the control based on its content or set the height in the code based on states etc?
Cass
Contributor
3157 points
654 Posts
03-13-2008 6:10 AM |
If you set the UserControl Width/Height to Auto, and use HorizantolAlignment/VerticalAlignment to "Stretch" with Margins 0 it should do it automatically.
03-18-2008 5:42 PM |
Its not working for me.
the with/height overrite it from the asp:silverlight tag.
And if i dont specify thise, the control dont show.