internal override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
// Only interested in key processing if this button definition
// is enabled and itself and all parents are also visible
if (Enabled && ChainVisible)
{
// Do we have a shortcut definition for ourself?
if (ShortcutKeys != Keys.None)
{
// Does it match the incoming key combination?
if (ShortcutKeys == keyData)
{
// Button type determines what event to fire
switch (ButtonType)
{
case GroupButtonType.Push:
case GroupButtonType.Check:
PerformClick();
return true;
case GroupButtonType.DropDown:
case GroupButtonType.Split:
PerformDropDown();
return true;
default:
// Should never happen!
Debug.Assert(false);
break;
}
return true;
}
}
// Check the types that have a relevant context menu strip
if ((ButtonType == GroupButtonType.DropDown) ||
(ButtonType == GroupButtonType.Split))
{
if (KryptonContextMenu != null)
if (KryptonContextMenu.ProcessShortcut(keyData))
return true;
if (ContextMenuStrip != null)
if (CommonHelper.CheckContextMenuForShortcut(ContextMenuStrip, ref msg, keyData))
return true;
}
}
return false;
}