Code Comments
Programming Forum and web based access to our favorite programming groups.Hopefully, I'm missing something real simple in front of my face.
I've used the ProcessDialogKey override and I'm able to capture *most*
shortcut keystrokes, except for the one I'm really interested in.
It seems that the CTRL+F4 keystroke is being captured someplace before
my override can get it. Right now, because I can't capture the
CTRL-F4, the app uses ALT-X to close a MDI child. It works, but I hate
it.
What am I missing? Is there a setting someplace to force a MDI child
to execute the CLOSE() method? Does anyone know what is capturing the
CTRL+F4? I noticed a similar issue in VB6 that seemed to be related to
which types of controls had focus, but I couldn't actually duplicate
that in C#.NET.
Any help would be greatly appreciated.
NOTE: Here's the code that I'm using:
protected override bool ProcessDialogKey(Keys keyData)
{
switch (keyData)
{
case (Keys.Control | Keys.F4):
this.Close(); \\ NEVER FIRES
return true;
case (Keys.Alt | Keys.X):
this.Close(); \\ Used as a back-up to close form
return true;
};
return base.ProcessDialogKey(keyData);
}
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.