Hi, I have created a dialog with two TCalendar components so I can select & from & to date as I don't believe there is a from & to date calendar available. I have two issues which I cannot work out. Here is my code:
procedure TfCalendarDlg.ShowDateRangeDialog(var FromDate, ToDate: TDate);
var
Dialog: TfCalendarDlg;
begin
Dialog := TfCalendarDlg.Create(nil);
try
calFrom.DateTime := FromDate;
calTo.DateTime := ToDate;
if Dialog.ShowModal = mrOk then begin
FromDate := calFrom.DateTime;
ToDate := calTo.DateTime;
end;
finally
Dialog.Free;
end;
end;
1. when I assign a from date to to the first calendar and a to date to the second, this does not reflect on-screen. The selected day should be highlighted (lines 7,8)
2. when I select a new day at runtime on the calendar it does not reflect the chosen date in the datetime property (lines 10,11), it is still set to the original dates (lines 7,8).
It's as if the control is disconnected from the DateTime property. Any clues? Thank you.