1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| procedure TForm1.StringGrid1DrawCell(Sender: TObject; aCol, aRow: Integer;
aRect: TRect; aState: TGridDrawState);
const
Decalage=8;
begin
with StringGrid1 do
begin
Canvas.FillRect(aRect);
if Copy(Cells[aCol, aRow], 1, 1)=#9 then
Canvas.TextOut(aRect.Left+Decalage, aRect.Top, Cells[aCol, aRow])
else
Canvas.TextOut(aRect.Left, aRect.Top, Cells[aCol, aRow])
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
StringGrid1.Cells[1,1]:= 'Test';
StringGrid1.Cells[2,1]:= #9'Test';
end; |
Partager