Calling a method.
private void Dummy()
{
MessageBox.Show("Test");
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == (Keys.Enter))
{
Dummy();
return true;
}
return base.ProcessCmdKey(ref msg, keyData);
}