Frequently Asked Component Specific Questions
Options |
|
Display all FAQ items |
Displaying items 1 to 1 of 1, page 1 of 1
<< previous next >>

TAdvSmoothCalendarGroupAdding a status message for a day
Adding a status message is done by using the event OnDateStatus. In this event, the text can be set for a status message for each day with the parameter StatusMessage. A parameter of this event is Fill and this allows to choose a different appearance from the default status message appearance set by TAdvSmoothCalendar.StatusAppearance.
This code snippet shows how to add a status message for today in the default color and for the 15th of the month in green color:
procedure TForm1.AdvSmoothCalendar1DateStatus(Sender: TObject; Date: TDateTime;
var StatusMessage: string; Fill: TGDIPStatus; var OffsetX, OffsetY: Integer);
var
da,mo,ye: word;
begin
if date = int(now) then
begin
statusmessage := 'Now';
fill.Assign(AdvSmoothCalendar1.StatusAppearance);
end;
decodedate(date, ye, mo, da);
if da = 15 then
begin
statusmessage := 'halfway';
fill.Fill.Color := clLime;
fill.Fill.ColorTo := clGreen;
fill.Fill.ColorMirror := clNone;
fill.Fill.ColorMirrorTo := clNone;
end;
end;