i thought i solved this problem by myself but it came back to haunt my application so here it goes:
i have the following keydown event handler registered in a form with a couple of disabled and readonly textboxes and they are only simple shortcuts for the buttons:
private void AccountViewForm_KeyDown(object sender, KeyEventArgs e)
{
//e.SuppressKeyPress = true;
//e.Handled = true;
if (Control.ModifierKeys == Keys.Control && e.KeyCode == Keys.E && !isInEditMode)
btnEditMode_Click(sender, e);
if (Control.ModifierKeys == Keys.Control && e.KeyCode == Keys.S && isInEditMode) btnEditMode_Click(sender, e);
if (e.KeyCode == Keys.Escape) btnCancel_Click(sender, e);
if (Control.ModifierKeys == Keys.Control && e.KeyCode == Keys.W) Close();
}
the form has KeyPreview set to true but whenever a readonly textbox has focus and i press Ctrl + E i can't get "Control.ModifierKeys == Keys.Control" and "e.KeyCode == Keys.E" to be both true at the same time. What is really strange is that Ctrl + W works. Anyone has any idea what the hell is going on? :(