开发者

Setting ScrolViewArea scroll values?

I'm trying to move a scrollbar position in a ScrollViewArea in the code-behind. This is what I'm currently doing:

try
{
    ScrollViewer v = GetTemplateChi开发者_开发百科ld( "ScrollArea" ) as ScrollViewer;
    v.SetValue( ScrollViewer.HorizontalOffsetProperty, 0 );
}
catch(Exception e)
{
    System.Windows.MessageBox.Show(e.ToString());
}

But I keep getting an exception at v.SetValue.


I think you are looking for ScrollToHorizontalOffset method.

v.ScrollToHorizontalOffset(0);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜