public static void add(Control ctrl, on_wheel_func on_wheel) { var filter = new wheel_filter(ctrl, on_wheel); Application.AddMessageFilter(filter); ctrl.Disposed += (s, e) => Application.RemoveMessageFilter(filter); }