M
mikepope
I apologize if this has already been covered; I might be using the wrong
terminology to search for this. In a Word macro, I am displaying a form. I
want the ESC key to be the equivalent to clicking Cancel. Probably there's an
easy way to do this -- ?
For now, I have created a KeyDown handler for the control that has the focus
by default (the OK button). I look for keycode=27. This works fine, as long
as the focus is on the control that raises the event. What I was hoping was
that there is a way to forward (bubble) events from individual controls to
the containing form.
The form class does have a KeyDown event, but I'm not seeing how this would
ever be raised, since a control on the form would always have focus and
therefore always eat the event -- ?
I am curious about the possibilities for a) event bubbling and b) why the
form supports keystroke events, even if there IS an easy way to equate ESC
with Cancel. But that's asking kind of a lot.
terminology to search for this. In a Word macro, I am displaying a form. I
want the ESC key to be the equivalent to clicking Cancel. Probably there's an
easy way to do this -- ?
For now, I have created a KeyDown handler for the control that has the focus
by default (the OK button). I look for keycode=27. This works fine, as long
as the focus is on the control that raises the event. What I was hoping was
that there is a way to forward (bubble) events from individual controls to
the containing form.
The form class does have a KeyDown event, but I'm not seeing how this would
ever be raised, since a control on the form would always have focus and
therefore always eat the event -- ?
I am curious about the possibilities for a) event bubbling and b) why the
form supports keystroke events, even if there IS an easy way to equate ESC
with Cancel. But that's asking kind of a lot.