I am currently creating a program with Delphi (Professional, Version 7.0; Build 4.453).
Originally, I wanted to bold some dates in the TDateTimePicker dropdown calendar; but I quickly found out that I couldn't - so I'm trying to overlap a TMonthCalendar (with which you can do bold dates) on top of the TDateTimePicker dropdown calendar (simple, right?)
But not so fast: somehow, the TDateTimePicker dropdown calendar always shows up ON TOP of my TMonthCalendar. I would like to have the TMonthCalendar show up on top instead.
Here is what I figured I could do:
- Position TMonthCalendar under the TDateTimePicker (where its dropdown would usually show)
- Make visible the TMonthCalendar on the TDateTimePicker's OnDropDown event
- Hide the TMonthCalendar on the TDateTimePicker's OnCloseUp event
Here is what is happening:
- When I click on the dropdown triangle on the TDateTimePicker, the TMonthCalendar becomes visible (yay!)
- But the TDateTimePicker dropdown calendar always takes precedent (TMonthCalendar is always underneath the dropdown)
- Therefore I can't do anything with the TMonthCalendar until I've picked a date on the TDateTimePicker dropdown (I can't even see the bolded dates because TMonthCalendar is underneath).
Here is what I've tried:
- TMonthCalendar.Show on the OnDropDown event of the TDateTimePicker (this is supposed to bring whatever is Show-ed to the top). But this does nothing.
- Do DateMode: dmDropDown -> DateMode: dmUpDown on TDateTimePicker's OnDropDown (thus disabling the dropdown calendar). But this has problems since clicking anywhere on the MonthCalendar (including the change Month buttons on either side of the top) will render the MonthCalendar to become invisible (I'm doing "if MonthCalendar.Visible then visible := false" in MonthCalendarOnClick)
I know the solution is probably simple, but I can't think of a way to do this. So far the few ideas that I've come up with aren't working :( So if you can think of of a way to do what I want, please help me out.
Thank you in advance! :)