procedure TFormHaupt.SGPDrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
var Grid: TStringGrid;
oldalign : word;
begin
begin
Grid := Sender
as TStringGrid;
if gdSelected
in State
then
begin
Grid.Canvas.Font.Color := clBlack;
Grid.Canvas.Brush.Color :=
RGB(215, 238, 255);
Grid.Canvas.Font.Style := [fsBold];
end else Grid.Canvas.Brush.Color := Grid.Color;
Grid.Canvas.TextRect(Rect, Rect.Left + 2, Rect.Top + 2, Grid.Cells[ACol, ARow]);
end;
begin
if (aRow = 0)
and not (gdFixed
In State)
then
begin
with (sender
as tstringgrid).canvas
do
begin
Pen.Color := clBlack;
Pen.Width := 2;
Pen.Style := psSolid;
MoveTo( rect.left-1, rect.bottom );
Lineto( rect.right-1, rect.bottom );
end;
end;
end;
if (aRow=0)
then
begin
Grid.canvas.font.style := Grid.canvas.font.style + [fsbold];
end;
if (aRow=0)
then
begin
Grid.canvas.font.Size:= 10;
Grid.Canvas.Brush.Color :=
RGB(238, 238, 238);
Grid.Canvas.FillRect(Rect);
end;
begin
oldalign:=settextalign(Grid.canvas.handle,ta_left);
Grid.canvas.textrect(rect,rect.left+2,rect.top+2, Grid.cells[aCol,aRow]);
settextalign(Grid.canvas.handle,oldalign);
end;
end;