We help IT Professionals succeed at work.

How do you set the MCS_DAYSTATE style on a CMonthCalCtrl that's created from CDateTimeCtrl

Peter Voytershark
Peter Voytershark asked
I'm creating a C++ application in Visual Studio 2010 the will run on Windows Server 2008.  My Google search came up with a link to your site, as having an answer to the issue with adding the MCS_DAYSTATE style on the CMonthCalCtrl control when it's created from the dropdown date time control CDateTimeCtrl.  The link said Microsoft created a new function in Visual Studio 2008 called SetMonthCalStyle() to set the said style above as the calendar control is being created when it's dropdown from CDateTimeCtrl. So, my question is how do you set the MCS_DAYSTATE style on the CMonthCalCtrl control class that is created by the CDateTimeCtrl control class?

Watch Question

Top Expert 2012

Top Expert 2016
after I set my mfc project to use UNICODE strings the following compiled:

CDateTimeCtrl dt;

Open in new window

Peter VoytersharkSenior Applications Developer


I'm converting our applications to UNICODE, so the said Microsoft functionality in the CMonthCalCtrl class can be used.