neater way to phrase this

Tech-Archive recommends: Fix windows errors by optimizing your registry



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();
}

.



Relevant Pages

  • Re: System.IO.Ports.SerialPort performance problem
    ... You realize this is a compact ... Is this causing an actual problem? ... I have tried only read the data without writing to ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Removing None objects from a sequence
    ... Your goal should be clarity of code, not saving keystrokes. ... Writing something that is compact in terms of the amount of code to write does not mean its function is clear or even that it is more efficient to run, ...
    (comp.lang.python)
  • Change a constant value, depending on a generic
    ... Is there a more clever and compact way to do this, rather than writing ... component instantiation later on. ...
    (comp.lang.vhdl)
  • Re: is there a difference in the lines of comments
    ... rod. ... the entire file into memory before writing it to the response stream. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: is there a difference in the lines of comments
    ... rodchar wrote: ... //using (BinaryReader reader = new BinaryReader(new ... The WriteFile method uses a little less resources, as it doesn't read the entire file into memory before writing it to the response stream. ...
    (microsoft.public.dotnet.framework.aspnet)