public Window() { InitializeComponent(); mskTime.KeyPress += new KeyPressEventHandler(keypressed); } private void keypressed(Object o, KeyPressEventArgs e) { // the C here doesn't work if (Control.ModifierKeys == Keys.Control && e.KeyChar != (char)Keys.C) { e.Handled = true; } }
KeyPress
KeyDown
PreviewKeyDown
if ((Control.ModifierKeys == Keys.Control) && ((int)e.KeyChar != 3)) { e.Handled = true; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)