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;
Bon Coding ....
ManChesTer.
|