Click here to Skip to main content
15,887,596 members
Articles / Programming Languages / C# 5.0
Tip/Trick

Keyboard Control .NET

Rate me:
Please Sign up or sign in to vote.
4.18/5 (5 votes)
26 Jul 2015CPOL 12.3K   582   6   1
Custom .NET Numerical Keyboard Control

Introduction

This is a simple fixed-size numerical keyboard for .NET (WinForms) which can be connected to other .NET controls (e.g. Textboxes or Labels).

Supports all versions from 2.0 to 4.5.1 of .NET Framework (x86 and x64).

The control has 2 styles available as shown in the picture below.

You can use this control for FREE (even in commercial projects).

Background

This custom control has been made because there is a possibility I will need such a control in my future projects.

Using the Code

Usage is simple - you download the .dll, put it in Visual Studio Toolbox and put the "KBDControl" from ToolBox to your form.

To connect this keyboard to other controls (e.g., Textboxes or Labels), use "DialClick" event of the control.
This particular event captures clicks on the keyboard buttons.

To get numbers from the keyboard, use this simple code:

C++
private void kbdControl1_DialClick_1(object sender, EventArgs e)
 {
  KBDLabel.Text = kbdControl1.DialText;
 }

KBDLabel is the label which I have put on the form.

kbdControl1 is this custom control which has string property named "DialText" where it stores all
values from the buttons you pressed.

History

  • Version 1.0

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Croatia Croatia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionCode missing Pin
vincennes28-Jul-15 3:58
professionalvincennes28-Jul-15 3:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.