// Filter for keys public void KeyFilter(object sender, KeyEventArgs e) { if (!InputFilter.IsKeyAllowed(e.Key)) { e.Handled = true; } }