Short cuts are a PITA, much of the time.
You can set the ShortCutKeys property of menu controls, but if that doesn't cover what you want (and it rarely does) then you have to pretty much handle it yourself, and that is normally on a Form basis (or they only work when the custom control has the focus, which is difficult for users to handle).
To handle it by Form, override the ProcessCmdKey method:
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
Keys keyOnly = keyData & ~Keys.Modifiers;
Keys modifiersOnly = Control.ModifierKeys & (Keys.Shift | Keys.Control | Keys.Alt);
if (modifiersOnly == 0)
{
switch (keyOnly)
{
case Keys.Enter:
tsbvPlaySelected.PerformClick();
return true;
}
}
else if ((modifiersOnly & Keys.Control) != 0)
{
switch (keyOnly)
{
case Keys.D:
tsbvRename.PerformClick();
return true;
case Keys.Add:
tsbvAddSelectedToLastList.PerformClick();
return true;
case Keys.Subtract:
tsbvRemoveSelectedFromLastList.PerformClick();
return true;
}
}
return base.ProcessCmdKey(ref msg, keyData);
}