I am using a TDateTimePicker to allow the user to select a day (either manually or by clicking buttons to go forward or back one day). The user will then see log entries for that particular day.
The control works great, but I want to restrict the user to between [OLDEST-DAY-IN-LOG] and [TODAY], because those are the date limits where there is data.
I've set the MinDate and MaxDate on the TDateTimePicker and that works fine. Selecting a date outside the allowed range does nothing.
My question is whether it is possible to draw the invalid dates greyed out. In the attached image, the date selected is 01/04 and today is 02/04. I'd like to see 03/04 (and later) disabled. Ideally, like the "30" and "31" you see in the image which are the last days of March.
Is this possible? Using Delphi 7 if that is relevant.
TDateTimePicker
is a wrapper for a Win32 DTP control, which does not provide the functionality you are looking for. There is no option for custom drawing the drop-down calendar, and the only per-day styles available are normal and bold.