Код:
TOnGetMonthInfoEvent = procedure(Sender: TObject; Month: LongWord;
var MonthBoldInfo: LongWord) of object;
FOnGetMonthInfo: TOnGetMonthInfoEvent;
property OnGetMonthInfo: TOnGetMonthInfoEvent read FOnGetMonthInfo write FOnGetMonthInfo;
procedure TMonthCalendar.CNNotify(var Message: TWMNotify);
var
ST: PSystemTime;
I, MonthNo: Integer;
CurState: PMonthDayState;
begin
with Message, NMHdr^ do
begin
case code of
MCN_GETDAYSTATE:
with PNmDayState(NMHdr)^ do
begin
FillChar(prgDayState^, cDayState * SizeOf(TMonthDayState), 0);
if Assigned(FOnGetMonthInfo) then
begin
CurState := prgDayState;
for I := 0 to cDayState - 1 do
begin
MonthNo := stStart.wMonth + I;
if MonthNo > 12 then MonthNo := MonthNo - 12;
FOnGetMonthInfo(Self, MonthNo, CurState^);
Inc(CurState);
end;
end;
end;
end;
end;
inherited;
end;
CurState возвращает год.
FOnGetMonthInfo =
procedure TForm1.MonthCalendar1GetMonthInfo(Sender: TObject; Month:
Код:
Cardinal; var MonthBoldInfo: Cardinal);
begin
MonthCalendar1.BoldDays([15], MonthBoldInfo);
end;
Я запутался.