Link to home
Start Free TrialLog in
Avatar of chlade
chlade

asked on

KeyPreview = True and hotkeys

I have a form that needs to trap for a keypress at the form level.  However, when I set KeyPreview to True it causes hotkeys and the Accept button to not work.

For instance, I have a button called Add with the A as a hotkey.  The button is also the AcceptButton for the Form.  When I press ALT-A or press Return, the button is not pressed.  How can I make this happen?
ASKER CERTIFIED SOLUTION
Avatar of appari
appari
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of chlade
chlade

ASKER

That helped me find the problem ... though unfortunately not the solution.  But I know that I won't find the solution here.

The program is compiled as a DLL that is then loaded from our Accounting system.  This is where the problem is.  When I change the program to a standard Windows program and run it, it's fine.  There are a lot of flaky things going on when calling programs from our Accounting system so I'm sure that this is just one more.  Thanks!