Turn off mousewheel event

0
0

Hello,

when a NumericUpDown control has the focus,

the mousewheel increases/decreases its value.

How to turn off the mousewheel event ?

Thanks.

  • You must to post comments
0
0

The third way works for me.

Thanks

 

 

  • You must to post comments
0
0

You can. There are several ways:

1 – Add a javascript extender and add this script to the numericUpDown control:

this.removeListener('roll', this._onRoll);

2- When the control is created, or the container window page are created:

Eval("this.numericUpDown1.removeListener('roll', this.numericUpDown1,_onRoll)");

3- Create a MyNumericUpDown class like this:

 

 public class MyNumericUpDown : NumericUpDown
 {
   public MyNumericUpDown()
   {
     this.ControlCreated += MyNumericUpDown_ControlCreated;
     Application.ApplicationRefresh += Application_ApplicationRefresh;
   }

   protected override void Dispose(bool disposing)
   {
     base.Dispose(disposing);
     Application.ApplicationRefresh -= Application_ApplicationRefresh;
   }

   private void MyNumericUpDown_ControlCreated(object sender, EventArgs e)
   {
     DisableRoll();
   }

   private void Application_ApplicationRefresh(object sender, EventArgs e)
   {
     DisableRoll();
   }

   private void DisableRoll()
   {
     Eval("this.removeListener('roll', this._onRoll, this)");
   }
 }

 

 

 

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.