Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 22-01-2005
Avatar de gluglu
[gluglu] gluglu is offline
Miembro Premium
 
Registrado: sep 2004
Ubicación: Málaga - España
Posts: 1.455
Poder: 21
gluglu Va por buen camino
Centrar celdas en un TSTringGrid

Sé que es una pregunta muy tonta, pero no la resuelvo por incompatibilidad entre los tipos Integer y Double.

Qué me falta para poder centrar el texto dentro de una celda de un TStringGrid ?

Código Delphi [-]
procedure TMaster.StringGrid1DrawCell(Sender: TObject; ACol,
  ARow: Integer; Rect: TRect; State: TGridDrawState);
var
  Txt: String;
  Lon: Byte;
begin
  Txt := StringGrid1.Cells[ACol,Arow];
  If ACol = 0 then
    StringGrid1.Canvas.TextRect(Rect,Rect.Left+3,Rect.Top,Txt)
  else
    begin
      Lon := Canvas.TextWidth(Txt);
      StringGrid1.Canvas.TextRect(Rect,Lon,Rect.Top,Txt);
    end;
Si pongo
Código Delphi [-]
Lon := Canvas.TextWidth(Txt)/2;
me dá error.

Gracias
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 18:26:52.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi