Disabling the OnOK in CDialog
-
Hello. Is it somehow possible to disable the linking between VK_RETURN and CDialog::OnOK? Whenever I press ENTER in my dialog, it calls the OnOK, and I would like to avoid this.. Is it possible?
- Give the OK button another ID besides IDOK. 2) In the
OnOK()
handler, don't call the base classCDialog::OnOK()
. http://www.codeproject.com/cpp/cppforumfaq.asp#mfc\_dlgclosekeys
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
- Give the OK button another ID besides IDOK. 2) In the
-
Hello. Is it somehow possible to disable the linking between VK_RETURN and CDialog::OnOK? Whenever I press ENTER in my dialog, it calls the OnOK, and I would like to avoid this.. Is it possible?
-
- Give the OK button another ID besides IDOK. 2) In the
OnOK()
handler, don't call the base classCDialog::OnOK()
. http://www.codeproject.com/cpp/cppforumfaq.asp#mfc\_dlgclosekeys
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
I tried to override OnOK, and yes, the dialog doesn't close, but if I then add an OnKeyDown-handler to my dialog, it never receives any VK_RETURN-notifications.. Is this beacuse MFC "grabs" the VK_RETURN, and sends it to OnOK, or just beacuse I'm doing something wrong?
- Give the OK button another ID besides IDOK. 2) In the
-
I tried to override OnOK, and yes, the dialog doesn't close, but if I then add an OnKeyDown-handler to my dialog, it never receives any VK_RETURN-notifications.. Is this beacuse MFC "grabs" the VK_RETURN, and sends it to OnOK, or just beacuse I'm doing something wrong?
Depending on which control has focus, the dialog may not even "see" the key presses. Tell us more of what you are trying to do.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)