~~~~~~~~~~~~~~~~~~~~~~~~~
uses
CommCtrl;
//interface
type
THackCommonCalendar = class(TCommonCalendar) ;
//implementation
procedure TForm1.DateTimePicker1DropDown(Sender: TObject) ;
var
Style: Integer;
ReqRect: TRect;
MaxTodayWidth: Integer;
begin
with THackCommonCalendar(Sender as TDateTimePicker) do
begin
Style := GetWindowLong(CalendarHandle, GWL_STYLE) ;
SetWindowLong(CalendarHandle, GWL_STYLE, Style or MCS_WEEKNUMBERS) ;
FillChar(ReqRect, SizeOf(TRect), 0) ;
Win32Check(MonthCal_GetMinReqRect(CalendarHandle, ReqRect)) ;
MaxTodayWidth := MonthCal_GetMaxTodayWidth(CalendarHandle) ;
if MaxTodayWidth > ReqRect.Right then ReqRect.Right := MaxTodayWidth;
SetWindowPos(CalendarHandle, 0, 0, 0, ReqRect.Right, ReqRect.Bottom, SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOZORDER) ;
end;
end;
~~~~~~~~~~~~~~~~~~~~~~~~~
Delphi tips navigator:
» How to enable file download from an asp.net page
« From TTime and TDate to TDateTime

