public class MyRichTextbox : RichTextBox
{
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if ((keyData == (Keys.Control | Keys.Enter)))
{
MessageBox.Show("ctrl+enter");
return true;
}
else if (keyData==Keys.F5)
{
MessageBox.Show("f5");
return true;
}
else
{
return base.ProcessCmdKey(ref msg, keyData);
}
}
}
{
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if ((keyData == (Keys.Control | Keys.Enter)))
{
MessageBox.Show("ctrl+enter");
return true;
}
else if (keyData==Keys.F5)
{
MessageBox.Show("f5");
return true;
}
else
{
return base.ProcessCmdKey(ref msg, keyData);
}
}
}