f0xi
Messages postés4205Date d'inscriptionsamedi 16 octobre 2004StatutModérateurDernière intervention12 mars 202235 3 sept. 2008 à 16:14
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState);
var S : string;
begin
S := StringGrid1.Cells[ACol, ARow];
with StringGrid1.Canvas do
begin
{ Gestion des etats des cellules }
{==
if gdSelected in State then
begin
// La cellule est actuellement sélectionnée.
end
else
if gdFocused in State then
begin
// La cellule détient la focalisation d'entrée.
end
else
if gdFixed in State then
begin
// La cellule est dans une région fixe de la grille.
end
else
begin
// La cellule ne possede aucun etat (etat normal)
end;
}
FillRect(Rect);
DrawText(Handle, PChar(S), -1, Rect, DT_CENTER or DT_VCENTER or DT_SINGLELINE);
end;
end;