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
on
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?

...Peter
Comment
Watch Question

jkr
Top Expert 2012

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

CDateTimeCtrl dt;
dt.SetMonthCalStyle(MCS_DAYSTATE);

Open in new window


Sara
Peter VoytersharkSenior Applications Developer

Author

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

...Peter