Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TPlanner
Setting background color of an individual header

By default, the background color for header cells in the Planner is set with Planner.Header.Color / Planner.Header.ColorTo and this color is applied to all header cells. If there is a need to draw attention to a specific position in the Planner, it is easily possible to set a specific header for this position in a different color. This can be done by implementing the OnHeaderDrawProp() event like:

procedure TForm5.Planner1HeaderDrawProp(Sender: TObject; SectionIndex: Integer;
  var AColor, AColorTo: TColor; AFont: TFont);
begin
  if (SectionIndex = 1) then
  begin
    AColor := clYellow;
    AColorTo := AColor;
  end;
end;
The SectionIndex is the index of the header cell, starting with 0 for the first position. With AColor & AColorTo parameters, the background gradient color can be set.