开发者

keyboard instead of mouse: no KillFocus is called

开发者 https://www.devze.com 2023-02-01 02:40 出处:网络
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 requiredfields are filled.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消