469,612 Members | 1,930 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,612 developers. It's quick & easy.

Closing a form passes "Enter" key press to parent?

Hi all,

I am using C# 2.0.

Here is my problem. I have a modal form with an OK button. When the user, using tabs, activates the OK button and presses "Enter", in the Button event, I call:

this.DialogResult=DialogResult.OK;

This closes my modal form fine.

My problem is that the parent form receives the "Enter" key press event when my form is closed. Any idea why this happens and how to prevent it?

Thanks,

Huck
Mar 26 '07 #1
0 945

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by marcia | last post: by
1 post views Thread by Andrea Williams | last post: by
11 posts views Thread by Sven | last post: by
1 post views Thread by thechaosengine | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.