Skip to main content

Microsoft Silverlight

Answered Question ScrollViewer inserting margins and throwing off formattingRSS Feed

(0)

jpsscott
jpsscott

Member

Member

51 points

84 Posts

ScrollViewer inserting margins and throwing off formatting

I have a few ScrollViewers in a Grid control and the ScrollViewers have some scrollable content inside them.

 In Beta 2 everything looked fine.

I upgrade to RC0 and all of a sudden ScrollViewers have a margin of some type on them that misaligns my content.  Worst still the scrollbars themself seem to be cut off by a couple of pixels.

I tried setting margins to ScrollViewer control itself but this didn't work.

 How can I control this?  Do I have to worry about this in RTM?

Thanks for any advice,

James

StefanOlson
StefanOlson

Member

Member

232 points

111 Posts

Answered Question

Re: ScrollViewer inserting margins and throwing off formatting

You can set the padding to control the margins inside the ScrollViewer.  you can also control the width of the border on the ScrollViewer.  Here's what I do to make it appear with no margins and no border:

<ScrollViewer x:Name="PART_ScrollViewer" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Padding="0" BorderThickness="0">

 ...Stefan

http://www.olsonsoft.com/blogs/stefanolson

jpsscott
jpsscott

Member

Member

51 points

84 Posts

Re: ScrollViewer inserting margins and throwing off formatting

Yes, that definitely does the trick!

James

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities