Ver Mensaje Individual
  #2  
Antiguo 16-02-2019
Sir16 Sir16 is offline
Registrado
 
Registrado: sep 2018
Posts: 8
Reputación: 0
Sir16 Va por buen camino
Después de estar peleando unas buenas horas solo con esto encontré la solución añadiendo una linea antes de hacer el fillRect con muestro a continuación en el proceso del draw cell;


Código Delphi [-]
if Pos(#13,StringGrid1.Cells[Acol,Arow])<>0 then
    begin
      texto:= StringGrid1.Cells[Acol,Arow]+#13;
// lineas añadidas para arreglar el problema

      StringGrid1.Canvas.Brush.Color := StringGrid1.Color;
      StringGrid1.Canvas.FillRect(Rect);
      indice:= 0;
      repeat
        posicion := pos(#13,texto);
        with StringGrid1.Canvas do
        begin
          Brush.Color := StringGrid1.Color;
          textout(rect.Left,rect.Top+(indice*(textHeight(copy(texto,1,posicion-1))+5)),copy(Texto,1,posicion-1));
        end;
        inc(indice);
        delete(texto,1,posicion);
      until posicion = 0;
    end;

Espero que a alguien le sirva.
Responder Con Cita