WPF 调节树状图滚动条值

 

TreeViewAutomationPeer lvap = new TreeViewAutomationPeer(this.TreeViewOrg);
var svap = lvap.GetPattern(PatternInterface.Scroll) as ScrollViewerAutomationPeer;
if (svap!=null)
{
var scroll = svap.Owner as ScrollViewer;

double value = this.Vslider.Value * (scroll.ScrollableHeight / 100);
scroll.ScrollToVerticalOffset(value); //向下调节垂直滚动条的位置;
}

 

posted @ 2021-02-22 14:49  马玲  阅读(246)  评论(0编辑  收藏  举报