Change TMonthCalendar Behavior

In the process of porting one of my Win32 VCL applications from Delphi 2006 to delphi XE6, I encountered the following problem:

One of my forms has TMonthCalendar (connected to TPanel for recording) to help the user select the week to view on the chart. By week, I mean that Monday is the first day, and Sunday is the last (French). To achieve this week picker, I set the multiSelect property to true and put the following code inside the CalendarClick event:

MonthCalendar1.MultiSelect := True;
//Temporarily storing the selected day in a variable
TempoDate := MonthCalendar1.Date;

//searching for the monday right before the selected day (by user)
while dayOfWeek(TempoDate) <> 2 do
  TempoDate := IncDay( TempoDate , -1 );

//Setting the monday as the start date of the selection
MonthCalendar1.Date := TempoDate;
//Setting the Sunday as the last day of selection
MonthCalendar1.EndDate := IncDay(tempoDate, 6);

This works well on Delphi 2006 (compiled on a computer with XP victory). Now that I have ported the same code to Delphi XE6 (compiled on win7), I have the following problems:

  • ( > ) . , , 1- , . : '14 '14 , 1 - (, 29 ). . , 14 14 , 1 - .
  • ( , ) .

, .

:

  • XE6 → ()
  • Delphi 2006 → .

, TMonthCalendar .Date , , D2006 .EndDate. , VCL Microsoft Office MonthCalendar ( XP, SEVEN).

:

http://docwiki.embarcadero.com/Libraries/XE7/en/Vcl.ComCtrls.TMonthCalendar  http://msdn.microsoft.com/en-us/library/system.windows.forms.monthcalendar(v=vs.110).aspx

+4
1

, , , , .

, , - TMonthCalender, , multiselect.
, , , . , .
, , , . laredy Date EndDate, EndDate , , miygt MonthCalendar , , , . .

, :

TempDate := MonthCalendar1.Date;
WeekStart := StartOfTheWeek(TempDate);
WeekEnd := EndOfTheWeek(TempDate);

.

.

+1

All Articles