DBPlanner set Weekend Color

How can I set in DBPlanner for the Weekend Saturday, Sunday another color?
In DBPlannerMonthView I can set WeekendColor.

There is not a built-in setting in this particular setup, but you can always customize the background color with event Planner.OnPlannerBkgProp and modify ABrush.Color according to Position

It works. Is that the best solution?

procedure TMainForm.DBPlanner1PlannerBkgProp(Sender: TObject; Index,
Position: Integer; ABrush: TBrush; APen: TPen);
TheDate: TDateTime;
TheDayOfWeek: Integer;
TheDate := DBDaySource1.Day + Position - 1;
TheDayOfWeek := DayOfWeek(TheDate);
// Prüfe, ob TheDayOfWeek Samstag (7) oder Sonntag (1) ist
if (TheDayOfWeek = 7) or (TheDayOfWeek = 1) then ABrush.Color := clWebBeige;

You can also programmatically loop over Planner cells and change the individual cell background color but I think the use of OnPlannerBkgProp is easier and more elegant.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.