datetimepicker class - with dts_appcanparse style - can't tab out

不打扰是莪最后的温柔 提交于 2019-12-24 19:03:12

问题


when the user finishes editing, i get the DTN_USERSTRING - begs the question when does the user finish editing? after typing the date, TAB doesn't seem to generate this notification, nor i get dtn_keydown or any other; mouse or pressing ALT seem to do the trick, but i need to make the TAB finish the edit and move to the next control in the dialog and not get stuck in the DTP.. any ideas?

thanks a ton, srini.

references: documentation: http://msdn.microsoft.com/en-us/library/windows/desktop/bb761745(v=vs.85).aspx [^] the function is called after the user finishes entering the date

similar problem: see http://www.codeguru.com/forum/showthread.php?p=751286 [^] (no response)


回答1:


Seems that when CDateTimeCtrl dynamically creates CEdit to allow free edit, then it some how looses the ability to receive messages. It cannot even catch VK_TAB when overriding PreTranslateMessage().

Maybe consider to use a different control than CDateTimeCtrl:

http://www.codeproject.com/KB/miscctrl/datetimeeditctrl.aspx



来源:https://stackoverflow.com/questions/8012784/datetimepicker-class-with-dts-appcanparse-style-cant-tab-out

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!