A
Allen Anderson
I have a control that has a textbox embedded in it. This control is
sitting on a form that also has an ok button that is the default
button that closes the form (OK button). When that textbox has focus
and a user presses enter, the default button fires. So to stop this I
am overriding cmd key. However, the processing for the enter key
actually needs to happen in the parent. I have tried hooking the
onkey events and such from the textbox into the parent control but
none of them fire when there is a default button on the same form.
To fix this I could hang a delegate off the textbox and subscribe to
it from the parent and call it when the processcmdmessage is fire in
the textbox, but I'd rather avoid that. What I would really like to
do is find some way to send the key from the textbox to the parent
control cleanly through the message que. How exactly would I go about
doing this AND is this even the best approach for the end result that
I am needing?
sitting on a form that also has an ok button that is the default
button that closes the form (OK button). When that textbox has focus
and a user presses enter, the default button fires. So to stop this I
am overriding cmd key. However, the processing for the enter key
actually needs to happen in the parent. I have tried hooking the
onkey events and such from the textbox into the parent control but
none of them fire when there is a default button on the same form.
To fix this I could hang a delegate off the textbox and subscribe to
it from the parent and call it when the processcmdmessage is fire in
the textbox, but I'd rather avoid that. What I would really like to
do is find some way to send the key from the textbox to the parent
control cleanly through the message que. How exactly would I go about
doing this AND is this even the best approach for the end result that
I am needing?