I am currently working on a legacy program built in C++Builder 5.
I am working on an area where we have a few TDateTimePicker controls. The dtp itself works correctly, but due to a localization issue I am currently working on, I am looking to remove the "Today" button at the bottom of the picker which lets the user click on it to automatically select today's date.
An alternative to this would be to just remove the formatted date string from the bottom, so that it says "Today" rather than "Today MM/DD/YYYY".
I have found a few solutions that allow for formatting of the Today text in other languages, but none for C++. I have tried using some of the built in functions, such as height and text, but have been unsuccessful. I am not usually the one who works in this code, so I may hopefully be missing something simple.
EDIT: I am using Windows XP in a VM for this project.
To remove the "Today" text, you have to enable the
MCS_NOTODAYwindow style on the DTP's child month calendar. That style has been available since Internet Explorer 3.In the
TDateTimePicker::OnDropDownevent, you can useDateTime_GetMonthCal()to get theHWNDof the month calendar and then useSetWindowLong/Ptr(GWL_STYLE)to enable theMCS_NOTODAYstyle.On Vista and later, you can alternatively use
DateTime_SetMonthCalStyle()to enable theMCS_NOTODAYstyle.