NumericKeypad 1.0.3
dotnet add package NumericKeypad --version 1.0.3
NuGet\Install-Package NumericKeypad -Version 1.0.3
<PackageReference Include="NumericKeypad" Version="1.0.3" />
<PackageVersion Include="NumericKeypad" Version="1.0.3" />
<PackageReference Include="NumericKeypad" />
paket add NumericKeypad --version 1.0.3
#r "nuget: NumericKeypad, 1.0.3"
#:package NumericKeypad@1.0.3
#addin nuget:?package=NumericKeypad&version=1.0.3
#tool nuget:?package=NumericKeypad&version=1.0.3
SmartNumericKeypad
A lightweight Windows Forms control that provides a borderless, draggable on-screen numeric keypad popup for TextBox and NumericUpDown controls.
π― Purpose
Physical keyboards aren't always available in touch-screen or kiosk-style desktop applications. NumericKeypad provides a popup keypad that attaches to any TextBox or NumericUpDown, letting users enter numeric values by tapping on screen instead.
β¨ Features
- Borderless, draggable popup window (drag by the top bar)
- Works with both
TextBoxandNumericUpDowntargets - Placeholder-aware input β clears placeholder text on the first keystroke
- Doesn't steal focus from the target control (
WS_EX_NOACTIVATE) - Portuguese (pt-PT) locale β comma decimal separator, Portuguese labels
- Digits 0β9, decimal separator, backspace, and close button
ποΈ Architecture
| Project | Role |
|---|---|
NumericKeypad.csproj |
Class library (.NET Framework 4.7.2) containing the NumericKeypad popup form |
| File | Purpose |
|---|---|
NumericKeypad.cs |
Form logic β constructor, event handlers, target control interaction |
NumericKeypad.Designer.cs |
Designer-generated layout (buttons, top bar, labels) |
NumericKeypad.resx |
Designer resources for the form |
Properties/AssemblyInfo.cs |
Assembly metadata and version info |
π οΈ Tech Stack
- Language: C#
- Framework: .NET Framework 4.7.2
- UI: Windows Forms (
System.Windows.Forms,System.Drawing) - Packaging: NuGet package
SmartNumericKeypad
π Quick Start
Prerequisites
- Visual Studio 2019+ (or MSBuild) with the .NET Framework 4.7.2 targeting pack installed
Setup
msbuild NumericKeypad.csproj /p:Configuration=Release /p:Platform=AnyCPU
Output: bin/Release/NumericKeypad.dll
Usage
using NumericKeypad;
// Attach to a TextBox
var textBox = new TextBox { Text = "Enter amount..." };
var keypad = new NumericKeypad(textBox, placeholderText: "Enter amount...");
keypad.Show();
// Attach to a NumericUpDown
var numericUpDown = new NumericUpDown();
var keypad2 = new NumericKeypad(numericUpDown);
keypad2.Show();
Typical pattern: show the keypad on Enter/Click of the target control, positioned near it, and let the user tap digits, backspace, comma, or "Fechar" to close.
π Configuration
No configuration files are required β behavior is controlled entirely through the constructor:
public NumericKeypad(Control target, string placeholderText = null)
targetβ theTextBoxorNumericUpDownto receive input; throwsArgumentExceptionif it's neitherplaceholderTextβ optional placeholder value that gets cleared on the first digit press
π§ͺ Testing
No automated test project is included in this repository. Verify changes manually by attaching the keypad to a TextBox and a NumericUpDown in a test form and exercising digits, backspace, decimal separator, dragging, and close.
π¦ Distribution
Packaging and publishing to NuGet.org is automated via nugetPackagePush.cmd:
nugetPackagePush.cmd
This builds the project (Release), commits/pushes to main, packs NumericKeypad.nuspec, pushes the package to nuget.org, and tags the release.
Note: The script contains a hardcoded NuGet API key and version numbers (
1.0.0β1.0.1) that must be updated manually before each release. Treat the API key as a secret.
π Documentation
See claude.md for the full architecture breakdown, designer layout details, and event-handler reference.
π Localization
UI text and decimal-separator behavior are hardcoded to Portuguese (pt-PT): "Teclado NumΓ©rico" title, "Fechar" close button, comma (,) as the decimal separator.
π License & Support
- Author: JoΓ£o Costa
- NuGet Package: SmartNumericKeypad
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
-
.NETFramework 4.7.2
- 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.