Press Keys for a Button on MDI form while child form has focus

Hi All,

   I have a button on an MDI form that I would like the user to be able to activate by pressing some keys on the keyboard.  Normally,  when the button is on a regular form,  it is easy;  you just place "&" in front of the letter that will be the hotkey such as E&xit allows the user to press ALT and X to cause the Exit button to be clicked or rather the keypress event to be fired.  However,  this does not work if the button is on an MDI form and the child form has the focus.  How do I handle this?

TIA
DoughBoy
DoughBoyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mcriderCommented:
Turn on the KeyPreview of all the child forms... Then in the KEYDOWN event of the child forms, look for your keystroke... If you find it then execute the button's subroutine...


Cheers!
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DoughBoyAuthor Commented:
thanks very much!
0
mcriderCommented:
Thanks for the points! Glad I could help!

By the way, any particular reason for a "B"?


Cheers!
0
DoughBoyAuthor Commented:
Well,  I believe your idea works, but I am unable to test it until I get access to certain parts of the code in our software that I normally can not get to.
It's nothing against you personally.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.