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. (Last updated on: November 16, 2018).
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?

Platform: WinForms |
Control: NumericUpDownExt |
Published Date: August 4, 2015 |
Last Revised Date: August 4, 2015

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.





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.





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

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment
Carlos Javier Flores Kanter
Nov 19, 2015
How can I do the samething but with JS? Reply

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

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