Touch Numpad
A numpad control that supports touch screen input.
Namespace: LSOne.Controls
Assembly: LSOne.Controls.TouchKeyboard
Syntax
public partial class TouchNumPad : UserControl
Constructors
Name |
Description |
---|---|
TouchNumPad() |
Default constructor |
Properties
Name |
Description |
---|---|
DigitStyle |
Get or set style of the digits. Uses the IStyle interface to set the font, fore color, back color and shape. |
DotKeyEnabled |
Get or set if the dot key is enabled. |
EnterKeyEnabled |
Get or set if the enter key is enabled. |
KeystrokeMode |
Get or set if the control should use keystroke mode. If true, when a button is pressed, a keyboard button press will be simulated. For example if this setting is true and a button is clicked while the focus is in a textbox, the corresponding keyboard button will be pressed and typed into the text box. |
MultiplyButtonIsZeroZero |
Get or set if the multiply button should be replaced with double zero. |
NegativeMode |
Get or set if the control should be in negative mode. |
ShowPlusMinusToggle |
Get or set if the control should display the plus minus toggle button. |
Style |
Get or set style of the buttons. Uses the IStyle interface to set the font, fore color, back color and shape. |
Events
Name |
Description |
---|---|
EnterPressed |
Occurs when the enter button is pressed |
ClearPressed |
Occurs when the clear button is pressed |
BackspacePressed |
Occurs when the backspace button is pressed |
PlusMinusPressed |
Occurs when the plus minus toggle button is pressed |
TouchKeyPressed |
Occurs when a numeric button is pressed. Uses the TouchKeyEventArgs which specifies the key of the pressed button. |
Code example
See Source\POS\Other\POSSharedDialogs\NumpadAmountQtyDialog.cs, Source\POS\Other\POSSharedDialogs\PayCashDialog.cs or Source\POS\Other\POSSharedDialogs\PayCurrencyDialog.cs from DevPack for usage examples.
private void touchNumPad1_BackspacePressed(object sender, EventArgs e)
{
if(textBox1.Text.Length > 0)
{
textBox1.Text = textBox1.Text.Substring(0, textBox1.Text.Length - 1);
}
}
private void touchNumPad1_ClearPressed(object sender, EventArgs e)
{
textBox1.Text = "";
}
private void touchNumPad1_TouchKeyPressed(object sender, Controls.EventArguments.TouchKeyKeyEventArgs args)
{
if(args.Key.IsNumeric())
{
textBox1.Text += args.Key;
}
}