Guest User

Untitled

a guest
May 21st, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. private readonly Key[] numeric = new Key[] {Key.Back, Key.NumPad0, Key.NumPad1, Key.NumPad2, Key.NumPad3, Key.NumPad4,
  2. Key.NumPad5, Key.NumPad6, Key.NumPad7, Key.NumPad8, Key.NumPad9 };
  3. private void SimpleTbx_KeyDown(object sender, KeyEventArgs e)
  4. {
  5. // handles non numeric
  6. if (Array.IndexOf(numeric, e.Key) == -1)
  7. {
  8. e.Handled = true;
  9. }
  10. }
Add Comment
Please, Sign In to add comment