UpDownNumericTextBox is a custom WPF TextBox that accepts only numbers.
- The text box receives numbers only.
- Numbers can be entered with floating Point (decimal numbers).
- Increment number can be increased using the Mouse Wheel when moving from top to bottom. The number increases by 1 for whole numbers or 0.1 for decimal numbers with each upward movement of the wheel and decreases by one with every movement of the wheel downward.
- The number can be increased using the Arrows Buttons Up/Down buttons on the keyboard.
- The increment amount can be multiplied by a specific value when holding down the Ctrl button on the keyboard.
- Requires .NET Framework 4.5
- Demo App :
Proprtiy | Description | Default |
---|---|---|
StepValue (decimal) | Mouse or keyboard up and down decimal step value (Accepts floating point) | 1 |
MinValue (decimal) | Minimum allowed decimal number | ±1.0 x 10-28 |
MaxValue (decimal) | Maximum allowed decimal number | ±7.9228 x 1028 |
MagnificationWithCtrlPressed | Number to multiply step value with when pressing CTRL while incrementing or decrementing number. Useful to easily reach target number | 10 |
- Import
UpDownNumericTextBox.dll
to your References in your C# project. - Add to XAML file
xmlns:CustomNumericTextBox="clr-namespace:CustomNumericTextBox;assembly=UpDownNumericTextBox"
- Create controls in your XAML file e.g.
<CustomNumericTextBox:UpDownNumericTextBox />
- Order of proprties is as the following:
- StepValue
- MinValue
- MaxValue
- MagnificationWithCtrlPressed