Модератор: Модераторы
procedure TFrameGrid.sgItemsDrawCell(Sender: TObject; aCol, aRow: Integer;
  aRect: TRect; aState: TGridDrawState);
var
  TH, TW: Integer;
  CellText: String;
begin
  CellText := sgItems.Cells[ACol, ARow];
  // подсветка выделенных ячеек
  if gdSelected in AState then
  begin
    sgItems.Canvas.Font.Color := clHighLightText;
    sgItems.Canvas.Brush.Color := clHighLight;
    sgItems.Canvas.FillRect(ARect);
    TH := sgItems.Canvas.TextHeight(CellText);
    TW := sgItems.Canvas.TextWidth(CellText);
    sgItems.Canvas.TextOut((ARect.Left + ARect.Right) div 2 - TW div 2, (ARect.Top + ARect.Bottom) div 2 - TH div 2, CellText);
  end;  
end;

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 1