[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 205
  • Last Modified:

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
0
DoughBoy
Asked:
DoughBoy
  • 2
  • 2
1 Solution
 
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
 
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

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now