Behavior Settings in Windows Forms NumericUpdown
18 Nov 20181 minute to read
The behavior settings of the NumericUpdown control are discussed below.
Intercept arrow keys
The arrow keys can be used to select values using the below given property.
| NumericUpdown Property | Description |
|---|---|
| InterceptArrowKeys | Gets / sets a value indicating whether the user can use the UP and DOWN ARROW keys to select values. |
this.numericUpDownExt1.InterceptArrowKeys = true; Me.numericUpDownExt1.InterceptArrowKeys = TrueMaxLength
The maximum length of the text can be set using the property given below.
| NumericUpdown Property | Description |
|---|---|
| MaxLength | Gets / sets the maximum length of the text that can be entered into the editable portion of the control. The default value is set to '32767'. |
this.numericUpDownExt1.MaxLength = 32800; Me.numericUpDownExt1.MaxLength = 32800ReadOnly
The ReadOnly mode can be enabled for the NumericUpdown control using the below given property.
| NumericUpdown Property | Description |
|---|---|
| ReadOnly | Gets / sets a value indicating whether the text can be changed by the use of the up or down buttons only. |
this.numericUpDownExt1.ReadOnly = true;Me.numericUpDownExt1.ReadOnly = True