tags:

views:

72

answers:

2
+1  Q: 

WPF scrollviewer

Is there a posibility to scroll to a specific place in a ScrollViewer from your code behind?

So something like the Slider element you can change the value property...

A: 

You need the ScrollToHorizontalOffset and ScrollToVerticalOffset methods.

Annoyingly, there aren't corresponding (settable) properties, so you can't databind the scroll position, but these methods do at least let you set it from code.

itowlson
A: 

In most cases if you're trying to show a specific control it's simpler to call BringIntoView on any FrameworkElement (Panel, Control, etc) contained in the ScrollViewer which will take care of all the size and offset calculations for you.

John Bowen
yes that is a nice option but not what i need.I really need to scroll in the scrollView.So it would be nice to have a Value or something like that (like the slider) that if i change that value, the scrolview slide to that place...
Bert