procedure TForm1.sgRegisDrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
procedure WriteText(StringGrid: TStringGrid; ACanvas: TCanvas;
const ARect: TRect;
const Text:
string);
const
DY = 2;
var
S:
array[0..255]
of Char;
begin
with Stringgrid, ACanvas, ARect
do begin
ExtTextOut(
Handle, Right - TextWidth(Text) - 3, Top + DY,
0, ARect, Text, Length(Text),
nil);
end;
end;
procedure Display(StringGrid: TStringGrid;
const S:
string);
begin
WriteText(StringGrid, StringGrid.Canvas, Rect, S);
end;
begin
if (ACol
in [1,4,6,7])
then
Display(sgRegis, sgRegis.Cells[ACol, ARow]);
end;