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