Buenas tardes:
Estoy usando StringGrid, pero necesito mostrar los datos numerico a la DERECHA, y entre esta rutina
Código Delphi
[-]Procedure TFGrillaComprobante.GrillaComprobanteDrawCell(Sender: TObject; ACol,
ARow: Integer; Rect: TRect; State: TGridDrawState);
procedure 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;
B, R: TRect;
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 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, Rect, S, Formats[Alignment]);
end;
begin
if (Arow > 0) and (ACol in [1,2,3,4,6,7,8,9,10]) then
Display(GrillaComprobante, GrillaComprobante.Cells[ACol, ARow], taRightJustify) ;
if (Arow mod 2) = 0 then begin
GrillaComprobante.Canvas.Brush.Color := clBlue
end else begin
GrillaComprobante.Canvas.Brush.Color := clred
end;
end;
La cual funciona perfectamente.
Pero con el GoRowSelect=True, cuando selecciono la fila, esta queda completamente en negro, no deja ver la informacion
(imagen comprobante.png)
Pero si dejo GoRowSelect=False, ahi me deja ver toda la informacion de la Fila
Pregunta, hay solucion o no, porque quiero dejar la GoRowSelect=True.
Gracias