When the user wants close an MFC window, it is done by pressing a specific button, CButton, IDCANCEL, 'Cancel'. The button is ebabled if all required fields are filled.
If the focus is in the last required Edit Box the user has two ways to close the wind开发者_开发百科ow, either point the mouse and press it or just press the keyboard return key.
Now, if he/she chooses to close the window by keyboard the last OnKillfocus is never called.
Is there any ideas to overcome this issue as the killfocus is important fot the specific window.
Thanks
There's no way to overcome that, and this is by design. 'Enter' key closes dialog on hit (while 'space' wouild do it on release).
I suggest you redesign your dialog code to put less functionality on KillFocus.
If it is about field validation, there're several common design patterns to achieve it.
精彩评论