How to make CDateTimeCtrl not editable, without arrows ?
-
I need to make CDateTimeCtrl not editable, without arrows ?
m_Planer.m_Current_Date .ModifyStyle(0, DTS_SHORTDATEFORMAT); m_Planer.m_Current_Time .ModifyStyle(0, DTS_TIMEFORMAT); //works
not works:m_Planer.m_Current_Date .ModifyStyle(DTS_UPDOWN | DTS_APPCANPARSE ,0 );
How to do subject? thanks -
I need to make CDateTimeCtrl not editable, without arrows ?
m_Planer.m_Current_Date .ModifyStyle(0, DTS_SHORTDATEFORMAT); m_Planer.m_Current_Time .ModifyStyle(0, DTS_TIMEFORMAT); //works
not works:m_Planer.m_Current_Date .ModifyStyle(DTS_UPDOWN | DTS_APPCANPARSE ,0 );
How to do subject? thanksHey! You can subclass this control and listen for WM_KEYDOWN message codes of arrows VK_LEFT (25) LEFT ARROW key VK_UP (26) UP ARROW key VK_RIGHT (27) RIGHT ARROW key VK_DOWN (28) DOWN ARROW key
switch (uiMsg) { case WM_KEYDOWN: { if(wParam>= VK_LEFT && wParam<=VK_RIGHT) return 0; } }
try to read something on subclusing on msdn and probably in this article you will find usefull info Pain is a weakness living the body