>when a control is in focus that responds to the shortcut that I'm trying to use [...] the control handles the keyboard shortcut before the forms keypress event ever sees it. Is there a way to override the kepress events in the controls on the form or is there in general a better way to deal with keyboard shortcuts?
1) form.KeyPreview = .T.
2) in form.KeyPress, in the CASE for appropriate keystroke: NODEFAULT
Other suggestion:
If your form's KeyPress method is handling the keystroke by setting focus to, and/or clicking, the appropriate object, you don't need to also handle that keystroke in the object's KeyPress event. Are you doing that? If so, take that code out the object's KeyPress method.
HTH
Rich Addison, Micro Vane, Inc., Kalamazoo, MI
Relax, don't worry, have a homebrew.
- Charlie Papazian, The New Complete Joy of Home Brewing