Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private readonly Key[] numeric = new Key[] {Key.Back, Key.NumPad0, Key.NumPad1, Key.NumPad2, Key.NumPad3, Key.NumPad4,
- Key.NumPad5, Key.NumPad6, Key.NumPad7, Key.NumPad8, Key.NumPad9 };
- private void SimpleTbx_KeyDown(object sender, KeyEventArgs e)
- {
- // handles non numeric
- if (Array.IndexOf(numeric, e.Key) == -1)
- {
- e.Handled = true;
- }
- }
Add Comment
Please, Sign In to add comment