MFC - Ignore enter-key presses

Aug 4, 2010 at 8:38pm
I have a dialog-based MFC application without buttons, just 2 textboxes. Whenever user presses enter, application exits. I've been searching for a way to ignore enter-key presses for a few days now and all I found were a few outdated solutions that didn't work for me, I have Visual Studio 2010.

Thanks in advance!
Aug 4, 2010 at 10:41pm
Use the Class Wizard to override the OnOK function for the dialog and don't call the baseclass function


Last edited on Aug 4, 2010 at 10:48pm
Aug 5, 2010 at 8:32am
Thanks, it works! I read about overriding function OnOk on multiple sites, but none of them said anything about Class Wizard.
Topic archived. No new replies allowed.