Skip to main content

Numeric Editors

NumberLike the MaskedTextBox, the NumericTextBox derives from ValueRangeTextBox and only supports numerical input. Through the NumberStyles property, a combination of values can be specified to indicate the permitted number styles that can be inputted. By default, NumberStyles.Numbers.

Table 1: NumberStyles values

MemberDescription
NoneIndicates that none of the bit styles are allowed.
AllowLeadingWhiteIndicates that a leading white-space character must be ignored during parsing.
AllowTrailingWhiteIndicates that trailing white-space character must be ignored during parsing.
AllowLeadingSignIndicates that the numeric string can have a leading sign.
AllowTrailingSignIndicates that the numeric string can have a trailing sign.
AllowParenthesesIndicates that the numeric string can have one pair of parentheses enclosing the number.
AllowDecimalPointIndicates that the numeric string can have a decimal point.
AllowThousandsIndicates that the numeric string can have group separators, for example, separating the hundreds from the thousands.
AllowExponentIndicates that the numeric string can be in exponential notation.
AllowCurrencySymbolIndicates that the numeric string is parsed as currency if it contains a currency symbol. Otherwise, it is parsed as a number.
AllowHexSpecifierIndicates that the numeric string represents a hexadecimal value.
IntegerIndicates that the AllowLeadingWhite, AllowTrailingWhite, and AllowLeadingSign styles are used. This is a composite number style.
HexNumberIndicates that the AllowLeadingWhite, AllowTrailingWhite, and AllowHexSpecifier styles are used. This is a composite number style.
NumberIndicates that the AllowLeadingWhite, AllowTrailingWhite, AllowLeadingSign, AllowTrailingSign, AllowDecimalPoint, and AllowThousands styles are used. This is a composite number style.
FloatIndicates that the AllowLeadingWhite, AllowTrailingWhite, AllowLeadingSign, AllowDecimalPoint, and AllowExponent styles are used. This is a composite number style.
Currencyndicates that all styles, except AllowExponent and AllowHexSpecifier, are used. This is a composite number style.
AnyIndicates that all styles, except AllowHexSpecifier, are used. This is a composite number style.