1 回答

TA貢獻(xiàn)1898條經(jīng)驗(yàn) 獲得超8個(gè)贊
這個(gè)怎么樣?
<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 關(guān)注
- 94 瀏覽
添加回答
舉報(bào)