sNumericTextBox 1.0.1

dotnet add package sNumericTextBox --version 1.0.1
                    
NuGet\Install-Package sNumericTextBox -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="sNumericTextBox" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="sNumericTextBox" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="sNumericTextBox" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add sNumericTextBox --version 1.0.1
                    
#r "nuget: sNumericTextBox, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package sNumericTextBox@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=sNumericTextBox&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=sNumericTextBox&version=1.0.1
                    
Install as a Cake Tool

This is a collection of TextBox derived classes for restricting user input to numeric values only. The classes in this collection are- IntTextBox LongTextBox UIntTextBox ULongTextBox FloatTextBox DoubleTextBox DecimalTextBox HexTextBox

For each class, the type name preceding "TextBox" ([TypeName]TextBox) denotes the value type the text will be converted to. All classes provide an internal "Value" property that keeps the numeric value converted from the text as the user types. If the text cannot be converted to a value, for example, due to exceeding the type's limit, the last value will be kept; however, the user can still continue inputting into the textbox.

When the value changes, the UIElement object raises a "ValueChanged" event.

Integer types

The Int and Long textboxes only accept number inputs and optional preceding "+" or "-". The UInt and ULong textboxes do not accept the preceding sign.

Decimal types

The Float, Double and Decimal textboxes accepts preceding sign and decimal ".". Optionally, the "Scientific" property can be set to "true" to accept scientific notation. The textboxes accepts incomplete text as well but it will not raise ValueChanged event. example: "-1.3e", "-1.3e-" are both valid inputs but will not raise ValueChanged event. "1.3", "-1.3e-2" will raise ValueChanged event.

Hexadecimal

The HexTextBox only accepts hexadecimal strings with optional "0x" prefix. If the user input does not have the prefix, it will be added automatically when the textbox loses focus. Additionally the following properties are available- AlwaysUpper: Formats the text to have upper case characters on losing focus. AlwaysLower: Formats the text to have lower case characters on losing focus. RestrictTo8Bytes: Restricts the user input to 8 byte value or 16 hexadecimal digits.

All the user input value can be accessed anytime from the "Value" property present in every class.

XML Namespace URI: https://github.com/Rakib1503052/NumericTextBox/

Example usage:

<Window x:Class="DemoApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ntb="https://github.com/Rakib1503052/NumericTextBox/"
        Title="CoolTextBox Demo" Height="200" Width="300">
    
	<Grid>
		<ntb:FloatTextBox Scientific="True"/>
		<ntb:HexTextBox AlwaysUpper="True" RestrictTo8Bytes="True"/>
	</Grid>
</Window>
Product Compatible and additional computed target framework versions.
.NET net6.0-windows10.0.17763 is compatible.  net7.0-windows was computed.  net8.0-windows was computed.  net9.0-windows was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0-windows10.0.17763

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 201 10/5/2025
1.0.0 185 10/5/2025