Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 设置ScrolViewArea滚动值?_C#_.net_Silverlight_Scrollview - Fatal编程技术网

C# 设置ScrolViewArea滚动值?

C# 设置ScrolViewArea滚动值?,c#,.net,silverlight,scrollview,C#,.net,Silverlight,Scrollview,我试图在代码后面的滚动视图区域中移动滚动条位置。这就是我目前正在做的: try { ScrollViewer v = GetTemplateChild( "ScrollArea" ) as ScrollViewer; v.SetValue( ScrollViewer.HorizontalOffsetProperty, 0 ); } catch(Exception e) { System.Windows.MessageBox.Show(e.ToString()); } 但

我试图在代码后面的
滚动视图区域中移动滚动条位置。这就是我目前正在做的:

try
{
    ScrollViewer v = GetTemplateChild( "ScrollArea" ) as ScrollViewer;
    v.SetValue( ScrollViewer.HorizontalOffsetProperty, 0 );
}
catch(Exception e)
{
    System.Windows.MessageBox.Show(e.ToString());
}

但是我保留。

我想您正在寻找
滚动到水平偏移量
方法

v.ScrollToHorizontalOffset(0);