单击鼠标滚轮时,我想关闭选项卡控件中的选项卡。如何在 WPF 中捕获此事件?
编辑:这是代码:
private void tabMain_MouseDown(object sender, MouseButtonEventArgs e)
{
if(e.ChangedButton == MouseButton.Middle && e.ButtonState == MouseButtonState.Pressed)
{
MessageBox.Show("Middle button clicked");
}
}