6
我想在點擊鼠標滾輪時關閉選項卡控件中的選項卡。如何在WPF中捕獲此事件?如何處理WPF中的鼠標滾輪點擊事件?
編輯: 下面的代碼:
private void tabMain_MouseDown(object sender, MouseButtonEventArgs e)
{
if(e.ChangedButton == MouseButton.Middle && e.ButtonState == MouseButtonState.Pressed)
{
MessageBox.Show("Middle button clicked");
}
}
是否有理由在** MouseDown **事件中檢查ButtonState == ButtonState.Pressed?或者它只是從某處複製/粘貼的? – Sinatr 2014-08-19 08:21:33