65.9K
CodeProject is changing. Read more.
Home

Keyboard Control .NET

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.18/5 (5 votes)

Jul 26, 2015

CPOL
viewsIcon

12722

downloadIcon

583

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:

 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