BinaryNumericExtendedText
A class derived from <seealso cref="BinaryExtendedText"/> that allows only numeric input or numeric input within a specified numeric range.
public class BinaryNumericExtendedText : BinaryExtendedText, ISupportInitialize
Inherits from / implements: BinaryExtendedText, ISupportInitialize
Remarks
The text is the value. There is no separate editing buffer: what the user types is checked as it arrives, clamped to the range while it is typed, and read back through Value as a number. Three things are worth knowing before changing any of it. Decimals are off until DecimalPlaces says otherwise, and the separator accepted is the current culture's, not a full stop. Stepping - the arrow keys, page keys and the wheel - moves by Step and is switched by EnableStepping. And the grouping separators are added when the control loses the focus and taken out again when it regains it, so the user never edits around them.
Members at a glance
BinaryNumericExtendedText | Creates a new instance of the BinaryNumericExtendedText .NET control. |
DecimalPlaces | Gets or sets how many decimal places the box accepts and shows. Zero, the default, is whole numbers only and no decimal separator is accepted. |
EnableStepping | Gets or sets whether the arrow keys, the page keys and the wheel step the value. |
Maximum | Gets or sets the maximum numeric value that can be set when using input range. |
Minimum | Gets or sets the minimum numeric value that can be set when using input range. |
SelectAllOnFocus | Gets or sets whether the text is selected when the box takes the focus, so that typing replaces the value rather than adding to it. |
ShouldIUseInputRange | Gets or sets as to whether an input range is to be used or not. |
ShowThousandsSeparator | Gets or sets whether the value is shown with the culture's grouping separators while the box does not have the focus. |
Step | Gets or sets how much the arrow keys, the page keys and the wheel move the value. |
Text | Gets or sets the Numeric text. Setting non-numeric text is not allowed! |
Value | Gets or sets the value as a number, or null when the box is empty. |
BeginInit | Implementation of ISupportInitialize.BeginInit. |
EndInit | Implementation of ISupportInitialize.EndInit. |
OnEnter | Raises the Enter event. The grouping separators come out for editing, and the text is selected when the control is asked to. |
OnKeyDown | Raises the KeyDown event. Up, down, page up and page down step the value. |
OnKeyPress | Raises the KeyPress event. BinaryNumericExtendedText overrides it so the control's own handling runs alongside the base behavior. |
OnLostFocus | Raises the LostFocus event. BinaryNumericExtendedText overrides it so the control's own handling runs alongside the base behavior. |
OnMouseWheel | Raises the MouseWheel event. A notch steps the value while the box has the focus. |
OnValueChanged | Raises the ValueChanged event. |
StepBy | Moves the value by one step, within the range when one is in force. |
ValueChanged | Raised when the numeric value changes, however it was changed - typed, stepped, or assigned. |
Constructors
BinaryNumericExtendedText
Creates a new instance of the BinaryNumericExtendedText .NET control.
Properties
DecimalPlaces
Gets or sets how many decimal places the box accepts and shows. Zero, the default, is whole numbers only and no decimal separator is accepted.
EnableStepping
Gets or sets whether the arrow keys, the page keys and the wheel step the value.
Maximum
Gets or sets the maximum numeric value that can be set when using input range.
Minimum
Gets or sets the minimum numeric value that can be set when using input range.
SelectAllOnFocus
Gets or sets whether the text is selected when the box takes the focus, so that typing replaces the value rather than adding to it.
ShouldIUseInputRange
Gets or sets as to whether an input range is to be used or not.
ShowThousandsSeparator
Gets or sets whether the value is shown with the culture's grouping separators while the box does not have the focus.
Step
Gets or sets how much the arrow keys, the page keys and the wheel move the value.
Text
Gets or sets the Numeric text. Setting non-numeric text is not allowed!
Value
Gets or sets the value as a number, or null when the box is empty.
Methods
BeginInit
Implementation of ISupportInitialize.BeginInit.
EndInit
Implementation of ISupportInitialize.EndInit.
OnEnter
Raises the Enter event. The grouping separators come out for editing, and the text is selected when the control is asked to.
- e
- The data for the event.
OnKeyDown
Raises the KeyDown event. Up, down, page up and page down step the value.
- e
- The data for the event.
OnKeyPress
Raises the KeyPress event. BinaryNumericExtendedText overrides it so the control's own handling runs alongside the base behavior.
- e
- The data for the event.
OnLostFocus
Raises the LostFocus event. BinaryNumericExtendedText overrides it so the control's own handling runs alongside the base behavior.
- e
- The data for the event.
OnMouseWheel
Raises the MouseWheel event. A notch steps the value while the box has the focus.
- e
- The data for the event.
OnValueChanged
Raises the ValueChanged event.
- e
- The data for the event.
StepBy
Moves the value by one step, within the range when one is in force.
- by
- How far to move it, positive or negative.
Events
ValueChanged
Raised when the numeric value changes, however it was changed - typed, stepped, or assigned.