Ví dụ sau bắt tổ hợp phím Alt + F4:
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == (Keys.Alt | Keys.F4)) {
MessageBox.Show ("Alt + F4 catched!");
return true; // The key is manually processed
} else
return base.ProcessCmdKey (ref msg, keyData);
}
No comments:
Post a Comment