WPF 禁止ListBox滚动条滚动

<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<EventSetter Event="RequestBringIntoView" Handler="ListBoxItem_RequestBringIntoView"></EventSetter>
</Style>
</ListBox.ItemContainerStyle>

 

private void ListBoxItem_RequestBringIntoView(object sender, RequestBringIntoViewEventArgs e)
{
e.Handled = true;
}

posted @ 2020-10-15 09:52  张汐  阅读(781)  评论(0)    收藏  举报