I had the same problem and was able to get the following work around from
Microsoft.
The problem is that Winforms bubbles ProcessDialogChar up to the top level
window, which in this case, is the MdiContainer. To work around the bug,
you need to override the ProcessDialogChar method of the MDI child forms
like the following:
Protected Overrides Function ProcessDialogChar(ByVal charCode As Char) As
Boolean
If charCode <> " "c And ProcessMnemonic(charCode) Then
Return True
End If
Return False ' Nmemonic is unhandled, Do not call base to bubble
up to MDI container
End Function 'ProcessDialogChar
HTH,
Don Worthley
The Main Thing is to keep the Main Thing the Main Thing
Anybody else seen this weird (wrong) behavior:
This is a simplified explanation of the behavior in my app...
MDI child form (call it form A) has a hot key assigned (say, for example, a
command button that says 'Message', hot key on the M (text = &Message) which
just displays a message box,
and another button which opens a second MDI child form (call it form B).
That all seems normal - here's where the app is behaving badly:
1) Open form A.
2) from form A, open form B
3) when B has focus, press Alt-M
You will see that the hot key will be processed by form A, which DOES NOT
HAVE THE FOCUS!!!!
Not sure if this behavior is specific to MDI children forms and some
sequence of opening them, but it should not function like that. Is this
behavior actually something that I need to write code to trap? anybody else
seen this? can you reproduce it?