有些时候我们需要在一个控件里获取鼠标滚轮事件
- 构造函数注册事件
this.PreviewMouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.Kk_MouseWheel);
- 事件实现
private void Kk_MouseWheel(object sender, MouseWheelEventArgs e)
{
int delta = e.Delta;
var ss = LineNo;
RoutedEventArgs arg = new RoutedEventArgs(HLZD.Infrastructure.SMS.MemoryEntitys.MGlobalData.Mousewell, delta.ToString()+"|"+ LineNo);
this.RaiseEvent(arg);
}