1 回答
TA贡献1898条经验 获得超8个赞
这个怎么样?
<TreeView>
<TreeView.Resources>
<Style TargetType="TreeViewItem">
<EventSetter Event="RequestBringIntoView" Handler="TreeViewItem_RequestBringIntoView"/>
</Style>
</TreeView.Resources>
<TreeViewItem Header="Some Headline" IsExpanded="True">
<TreeViewItem Header="Some Text" IsExpanded="True">
<TextBlock Width="400" Height="150" Background="PaleGreen"> Some Text in a Block</TextBlock>
</TreeViewItem>
</TreeViewItem>
</TreeView>
后面的代码:
private void TreeViewItem_RequestBringIntoView(object sender, RequestBringIntoViewEventArgs e)
{
e.Handled = true;
}
- 1 回答
- 0 关注
- 71 浏览
添加回答
举报