Modeless dialog closing when 'Enter' key is pressed?
-
Ok sorry for being dumb but I have been staring at this for a couple of days now and I am getting nowhere. My dialog has a menu with a couple of controls, the main one being a CTreeCtrl. I have captured the OnCancel() to prevent accidental closure but I notice that the 'Enter'/CR key causes the app to close and I have no idea why? It triggers an orderly close bypassing the OnCancel(). I know I have missed something but I just cannot see what. Any pointers? Many thanks Alan
-
Ok sorry for being dumb but I have been staring at this for a couple of days now and I am getting nowhere. My dialog has a menu with a couple of controls, the main one being a CTreeCtrl. I have captured the OnCancel() to prevent accidental closure but I notice that the 'Enter'/CR key causes the app to close and I have no idea why? It triggers an orderly close bypassing the OnCancel(). I know I have missed something but I just cannot see what. Any pointers? Many thanks Alan
Please ignore this. Just figured out that I did not have a handler in place for the OnOK. Thus the default behaviour was being called which closes the app. Doh! Sorry for wasting your time guys. Alan