procedure TForm1.StringGrid1DrawCell(Sender: TObject; Col, Row: Longint;
Rect: TRect; State: TGridDrawState);
var
Txt: array[0..255] of Char;
begin
StrPCopy(Txt, StringGrid1.Cells[Col, Row]);
SetTextAlign(StringGrid1.Canvas.Handle,
GetTextAlign(StringGrid1.Canvas.Handle)
and not (TA_LEFT or TA_CENTER) or TA_RIGHT);
ExtTextOut(StringGrid1.Canvas.Handle, Rect.Right - 2, Rect.Top + 2,
ETO_CLIPPED or ETO_OPAQUE, @Rect, Txt, StrLen(Txt), nil);
end;
|