Forum > LCL
TCalendar View disconnect with datetime
(1/1)
alvas:
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:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---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.
TRon:
Pardon my ignorance but do I really see that inside your dialog form you are creating that same dialog form ?
Navigation
[0] Message Index