numeric updown control c#

Posted by Raghav on Stack Overflow See other posts from Stack Overflow or by Raghav
Published on 2010-06-08T10:24:53Z Indexed on 2010/06/08 10:42 UTC
Read the original article Hit count: 381

Filed under:

I am using numeric updowncontrol. For min and max values changed listening for these events this.numDownMinLimit.ValueChanged += new System.EventHandler(this.numDownMinLimit_ValueChanged); this.numDownMaxLimit.ValueChanged += new System.EventHandler(this.numDownMaxLimit_ValueChanged);

step size set is 0.1

The eventhandler takes some time to complete.

If you keep the mouse pressed for a period of time and then release it, the eventhandler still executes with the previous values which were fired.

How do we prevent this scenario from occurring? I would like to discard the remaining events which are still in the queue, waiting to be handled, when the user releases the mouse button.

© Stack Overflow or respective owner

Related posts about c#3.0