We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to restrict the input mode in the NumericUpDownExt by using the Up/Down button alone?

You can restrict the input mode of the NumericUpDownExt by using the up/down buttons alone. This requirement can be achieved by the following steps.

  1. By hiding the caret (cursor point) in the NumericUpDownExt.
  2. By restricting value input via the KeyPress and MouseWheel.

 

Hide the caret:

The function, HideCaret helps to remove the caret (cursor point) from the NumericUpDownExt. The User32.dll should be imported to get the HideCaret function.

The following code example demonstrates the same.

 

C#

VB

 

Note: Hiding a caret does not destroy the current shape or invalidate the insertion point.

 

Restrict the KeyPress and MouseWheel input:

The value of the NumericUpDownExt can be changed via Mouse wheel, key press, and the Up/Down buttons, by default. As this requirement is to restrict the value update, other than the up/down buttons, it can be achieved by handling the Mouse wheel and Key press events in the NumericUpDownExt.

The following code example demonstrates the same.

 

C#

VB

 

Figure 1: Caret is hidden in the NumericUpDownExt

Sample Links:

C#: http://www.syncfusion.com/downloads/support/directtrac/141608/ze/NumericUpDownExt2123534338

VB: http://www.syncfusion.com/downloads/support/directtrac/141608/ze/NumericUpDownExt_VB-2004341231

Article ID: Published Date: Last Revised Date: Platform: Control:
5297 08/04/2015 08/04/2015 Windows Forms NumericUpDownExt
Did you find this information helpful?
Comments
Carlos Javier Flores Kanter Nov 19, 2015
How can I do the samething but with JS?
Reply
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon