Ver Mensaje Individual
  #4  
Antiguo 23-01-2005
Avatar de gluglu
[gluglu] gluglu is offline
Miembro Premium
 
Registrado: sep 2004
Ubicación: Málaga - España
Posts: 1.455
Reputación: 21
gluglu Va por buen camino
Gracias, me ha servido mucho tu explicación.

Finalmente ha quedado así :
Código Delphi [-]
var
  Txt: String;
  LonTxt: Integer;
begin
  Txt := StringGrid1.Cells[ACol,Arow];
  If ACol = 0 then
    StringGrid1.Canvas.TextRect(Rect,Rect.Left+3,Rect.Top,Txt)
  else
    begin
      LonTxt := Canvas.TextWidth(Txt) div 2;
      StringGrid1.Canvas.TextRect(Rect,Rect.Left+8-LonTxt,Rect.Top,Txt);
    end;
Debo indicar adicionalmente que el ancho de la celda es fijo por diseño y es = 16. Por ello 16/2 = 8 y es el valor que he puesto en Rect.Left+8-LonTxt

Saludos
Responder Con Cita