Hice unas modificaciones para ver la rejilla como la necesito pero me he topado con problemas al dibujarla.
Del codigo anterior que puse modifique esta propiedad del StringGrid
Código Delphi
[-]
procedure TfrmCaptura.StringGrid1DrawCell(Sender: TObject; ACol,
ARow: Integer; Rect: TRect; State: TGridDrawState);
var sCad: String;
i: Integer;
begin
if (ACol = 0) or (Acol = 3) or (Acol = 6) then
if ARow > 1 then
If StringGrid1.Cells[ACol,ARow] <> '' Then
begin
sCad := StringGrid1.Cells[ACol,ARow];
With StringGrid1 Do
with Canvas,Rect do
Begin
Canvas.Brush.Style := bsSolid;
case ACol of
0: Canvas.Brush.Color := clMoneyGreen;
3: Canvas.Brush.Color := clSkyBlue;
6: Canvas.Brush.Color := clAqua;
end;
Canvas.FillRect(Rect);
Canvas.TextOut(0,Top + 2,sCad);
End;
end;
If (ACol=1) Or (ACol=2) Then
if ARow > 1 then If StringGrid1.Cells[ACol,ARow] <> '' Then
Begin
sCad := StringGrid1.Cells[ACol,ARow];
With StringGrid1 Do
with Canvas,Rect do
Begin
Canvas.Brush.Style := bsSolid;
case ACol of
1: Canvas.Brush.Color := clYellow;
2: Canvas.Brush.Color := clRed;
end;
i:=Right-TextWidth(sCad + ' '); Canvas.FillRect(Rect);
Canvas.TextOut(i,Top + 2,sCad);
End;
End;
end;
Una manita para ver por que no se redibuja correctamente.