MFC - Ignore enter-key presses

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!
Use the Class Wizard to override the OnOK function for the dialog and don't call the baseclass function


Last edited on
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.