开发者

WPF scrollviewer

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

So something like the Slid开发者_StackOverflow中文版er element you can change the value property...


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜