Segui el procedimiento que encontre en otro hilo, pero no me funciona. Me podrían indicar donde esta el error. Anexo el codigo.
Código Delphi
[-]
procedure TComPagoDetalleACD.IngresosDrawCell(Sender: TObject; ACol,
ARow: Integer; Rect: TRect; State: TGridDrawState);
begin
if ACol = 0 then
Display(Ingresos, Ingresos.Cells[ACol,ARow], taCenter);
if ACol = 2 then
Display(Ingresos, Ingresos.Cells[ACol,ARow], taRightJustify);
end;
procedure TComPagoDetalleACD.WriteText(StringGrid: TStringGrid; ACanvas: TCanvas; const ARect: TRect;
const Text: string; Format: Word);
const
DX = 2;
DY = 2;
var
S: array[0..255] of Char;
begin
with Stringgrid, ACanvas, ARect do
begin
case Format of
DT_LEFT: ExtTextOut(Handle, Left + DX, Top + DY,
ETO_OPAQUE or ETO_CLIPPED, @ARect, StrPCopy(S, Text), Length(Text), nil);
DT_RIGHT: ExtTextOut(Handle, Right - TextWidth(Text) - 3, Top + DY,
ETO_OPAQUE or ETO_CLIPPED, @ARect, StrPCopy(S, Text),
Length(Text), nil);
DT_CENTER: ExtTextOut(Handle, Left + (Right - Left - TextWidth(Text)) div 2,
Top + DY, ETO_OPAQUE or ETO_CLIPPED, @ARect,
StrPCopy(S, Text), Length(Text), nil);
end;
end;
end;
procedure TComPagoDetalleACD.Display(StringGrid: TStringGrid; const S: string; Alignment: TAlignment);
const
Formats: array[TAlignment] of Word = (DT_LEFT, DT_RIGHT, DT_CENTER);
begin
WriteText(StringGrid, StringGrid.Canvas, B, S, Formats[Alignment]);
end;
Muchas Gracias.