新建一个类,继承IMessageFilter public class FormFilter : IMessageFilter { public bool PreFilterMessage(ref Message m) { if (m.Msg == 0x20A) return true; return false; } } 在需要禁用鼠标滚轮的窗体内加入下面的代码 FormFilter ff = new FormFilter(); Application.AddMessageFilter(ff)
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using WindowsFormsApplication7.App_Code; namespace WindowsFormsApp