Class NumericTextBox
Extends the NumberTextBoxBase class to handle numeric input and validation.
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Tools
Assembly: Syncfusion.Shared.Base.dll
Syntax
public class NumericTextBox : NumberTextBoxBase, IThemeProvider, IVisualStyle, ISupportInitialize, ISerializable
Remarks
The NumericTextBox is not to be used directly.
Constructors
NumericTextBox()
Overloaded. Creates an object of type NumericTextBox.
Declaration
public NumericTextBox()
Remarks
The NumericTextBox object will be initialized with the default values for the display and data properties. You need to set any specific values.
Properties
DeleteSelectionOnNegative
Gets or sets a value indicating whether to delete selection when number is changed to negative.
Declaration
public bool DeleteSelectionOnNegative { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
NumberDecimalDigits
Gets or sets the maximum number of digits for the decimal portion of the number.
Declaration
public int NumberDecimalDigits { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
Remarks
If the number requires two decimal points to accommodate the smallest denomination and this property will have the value 2 in this case. If there is a need to have a different value based on the locale, it will be automatically changed if the UseLocaleDefault property is True.
NumberDecimalSeparator
Gets or sets the decimal separator character that will be used for the display.
Declaration
public string NumberDecimalSeparator { get; set; }
Property Value
| Type |
|---|
| System.String |
Remarks
This value is initially set from the System.Globalization.NumberFormatInfo and can be changed based on your requirements or based on the locale.
NumberGroupSeparator
Gets or sets the separator to be used for grouping digits.
Declaration
public string NumberGroupSeparator { get; set; }
Property Value
| Type |
|---|
| System.String |
Remarks
This value is initially set from the System.Globalization.NumberFormatInfo and can be changed based on your requirements or based on the locale.
NumberGroupSizes
Gets or sets the grouping of NumberDigits in the NumberTextBox.
Declaration
public int[] NumberGroupSizes { get; set; }
Property Value
| Type |
|---|
| System.Int32[] |
Remarks
This value is initially set from the System.Globalization.NumberFormatInfo and can be changed based on your requirements or based on the locale.
NumberNegativePattern
Gets or sets the pattern to use when the value is negative.
Declaration
public int NumberNegativePattern { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
Remarks
This value is initially set from the System.Globalization.NumberFormatInfo and can be changed based on your requirements or based on the locale.
Methods
GetNumberEndPosition()
Gets the position of the last numeric character in the formatted text.
Declaration
protected virtual int GetNumberEndPosition()
Returns
| Type |
|---|
| System.Int32 |
GetNumberStartPosition()
Gets the position of the first numeric character in the formatted text.
Declaration
protected virtual int GetNumberStartPosition()
Returns
| Type |
|---|
| System.Int32 |
HandleBackspaceKey()
Handles the Backspace key press event with extended logic for negative sign handling.
Declaration
protected override bool HandleBackspaceKey()
Returns
| Type |
|---|
| System.Boolean |
Overrides
HandleCharacterKey(Char)
Handles character key input, resetting negative state if entire text is selected.
Declaration
protected override bool HandleCharacterKey(char charToBeInserted)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Char | charToBeInserted | The character to be inserted. |
Returns
| Type |
|---|
| System.Boolean |
Overrides
HandleDeleteKey()
Handles the Delete key press event with extended logic for negative sign handling.
Declaration
protected override bool HandleDeleteKey()
Returns
| Type |
|---|
| System.Boolean |
Overrides
HandleSubtractKey()
Handles the Subtract key press event with extended logic for selection and sign handling.
Declaration
protected override NumberModifyState HandleSubtractKey()
Returns
| Type |
|---|
| NumberModifyState |
Overrides
SetNumberFormatInfoInitValues()
Initializes the number formatting settings such as decimal digits and separators.
Declaration
protected void SetNumberFormatInfoInitValues()
ShouldSerializeNumberDecimalSeparator()
Indicates whether the NumberDecimalSeparator should not be serialized if the UseLocaleDefault property is set.
Declaration
protected bool ShouldSerializeNumberDecimalSeparator()
Returns
| Type |
|---|
| System.Boolean |
ShouldSerializeNumberGroupSeparator()
Indicates whether the NumberGroupSeparator should not be serialized if the UseLocaleDefault property is set.
Declaration
protected bool ShouldSerializeNumberGroupSeparator()
Returns
| Type |
|---|
| System.Boolean |
ShouldSerializeNumberGroupSizes()
Indicates whether the NumberGroupPattern should not be serialized if the UseLocaleDefault property is set.
Declaration
protected bool ShouldSerializeNumberGroupSizes()
Returns
| Type |
|---|
| System.Boolean |