|
-
Jun 21st, 2001, 04:16 AM
#1
Thread Starter
Addicted Member
Form closing when i press enter key?
WHY DO MY PROGRAMS CLOSE WHEN I PRESS ENTER?
AND HOW DO STOP THIS?
-
Jun 21st, 2001, 04:48 AM
#2
Monday Morning Lunatic
Erm, they won't unless your window procedure handles things like this. Are you using MFC?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jun 21st, 2001, 06:32 AM
#3
Thread Starter
Addicted Member
-
Jun 21st, 2001, 06:36 AM
#4
Monday Morning Lunatic
Override OnOK, or remove the OK button. In the same way, pressing escape triggers OnCancel (I think).
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jun 21st, 2001, 06:39 AM
#5
Thread Starter
Addicted Member
a lot of program that people i konw have that problem...my friend has that problem, and this program called PunkBuster for the online game half-life does it.....
can i just make the keypress event do somthing else? how would i do that?
-
Jun 21st, 2001, 10:23 AM
#6
Monday Morning Lunatic
With MFC, if you want to change the default behaviour, just override the methods in your dialogue box class.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jun 21st, 2001, 01:44 PM
#7
Thread Starter
Addicted Member
still cant figure it out...i deleted the ok and cancel buttons, and no where in any of my code is OnOK(); or OnCancel();
but it still closes when i press enter
-
Jun 21st, 2001, 03:13 PM
#8
Monday Morning Lunatic
That's because you need to override OnOK and OnCancel using ClassWizard.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|