hey all,
i'm trying to capture only numeric keys and was wondering if there was a
neater or compact way of writing the following snippet?
thanks,
rodchar
private void LayOutMain_KeyDown(object sender, KeyEventArgs e)
{
switch (e.Key.ToString())
{
case "D0":
case "NumPad0":
TxbResults.Text += "0";
break;
case "D1":
case "NumPad1":
TxbResults.Text += "1";
break;
case "D2":
case "NumPad2":
TxbResults.Text += "2";
break;
case "D3":
case "NumPad3":
TxbResults.Text += "3";
break;
case "D4":
case "NumPad4":
TxbResults.Text += "4";
break;
case "D5":
case "NumPad5":
TxbResults.Text += "5";
break;
case "D6":
case "NumPad6":
TxbResults.Text += "6";
break;
case "D7":
case "NumPad7":
TxbResults.Text += "7";
break;
case "D8":
case "NumPad8":
TxbResults.Text += "8";
break;
case "D9":
case "NumPad9":
TxbResults.Text += "9";
break;
default:
break;
}
BtnEnter.Focus();
}