I'm surprised that using a mnemonic key-combination on a Button would fire when a TextBox in WinForms has
focus, because it "captures" the mouse, however I'm not surprised it doesn't fire the 'Leave Event in the sense that ties in with dim memories of being frustrated using mnemonics.
So, a few years ago I gave up on using mnemonics on WinForm Controls on a Form, or in Container Controls (for Menus they seem to work fine).
I use this kind of code now:
private Keys ShiftAltS = Keys.Shift | Keys.Alt | Keys.S;
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData.HasFlag(ShiftAltS))
{
if(ActiveControl == YourTextBox)
{
YourButton.Focus();
YourButton.Capture();
return true;
}
}
return base.ProcessCmdKey(ref msg, keyData);
}
Actually, I use a fancier version of this that I intend to write an article or tip/trick about this year, here. But, this code, I hope, demonstrates a useful alternative if you don't get anywhere with mnemonics.