cs_vagabon
Messages postés31Date d'inscriptionlundi 4 novembre 2002StatutMembreDernière intervention13 juin 2003
-
11 juin 2003 à 22:47
NetCyrille
Messages postés14Date d'inscriptionlundi 4 novembre 2002StatutMembreDernière intervention13 juin 2003
-
13 juin 2003 à 08:03
Bonjour,
Je voudrais mettre une cellule de mon Tableau (TStringGrid) en Gras, est ce que vous pouvez me dire comment faire ?
cs_ManChesTer
Messages postés374Date d'inscriptionvendredi 20 octobre 2000StatutModérateurDernière intervention15 janvier 2021 13 juin 2003 à 00:33
Bon voila ...
1. Met la propriètè DefaultDrawing de ton Stringrid sur false
2. Insere le code suivant dans l'Evénement OnDrawCell:
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
with StringGrid1.canvas do
begin
if (Acol=0) or (Arow=0) then // si on dessine sur la colonne ou la rangée 0
Brush.color:=StringGrid1.FixedColor // definis la couleur de fond
else // sinon
Brush.color:=StringGrid1.Color; // definis la couleur de fond (Blanc par default)
Fillrect(rect);
Font.Style:=Font.Style+[Fsbold];
TextOut(Rect.Left,rect.Top+(Textheight(StringGrid1.Cells[ACol,ARow]) div 2),StringGrid1.Cells[ACol,ARow]);
end;
end;