I’m using Silverlight 4. I have a UserControl whose LayoutRoot is wrapped in a ScrollViewer. I’d like the scroll bar to only appear if the LayoutRoot overflows the page. It is possible to do it automatically, or should I write code to detect if the content will overflow and set the scrollbar visibility accordingly?
I’m using Silverlight 4. I have a UserControl whose LayoutRoot is wrapped in a
Share
You should be able to do it automatically using the
ScrollViewer.HorizontalScrollBarVisibilityandScrollViewer.VerticalScrollBarVisibilityproperties. Here’s a list of all possible values for those properties (theScrollBarVisibilityenumeration):I think “Auto” is what you’re looking for:
Hope this helps!