Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

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

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 21-06-2011
adrall adrall is offline
Miembro
 
Registrado: ene 2007
Posts: 94
Poder: 18
adrall Va por buen camino
Problema al alinear texto en StringGrid en XE

Utilizo el siguiente codigo para alinear texto en un StringGrid:

Código:
procedure TFormComandes.PartidesGridDrawCell(Sender: TObject; ACol,
  ARow: Integer; Rect: TRect; State: TGridDrawState);
var
  txt:String;
  i: integer;
begin
if ACol = 2 then                        //* Columna a alinear *//
   if ARow > 0 then                    //* Para no alinear la línea de los títulos *//
   if PartidesGrid.Cells[ ACol, ARow ] <> '' then
      begin
      txt := PartidesGrid.Cells[ ACol, ARow ];
      with PartidesGrid do
         with Canvas,Rect do
            begin
            i := Right-TextWidth( txt + ' ' );
            Canvas.FillRect( Rect );
            Canvas.TextOut( i, Top + 1, txt );
            end;
      end;
    end;
end;
Ahora en Delphi XE funciona correctamente EXCEPTO si la celda está seleccionada, en este caso dibuja el texto dos veces, alineado y sin
alinear, parece como si ejecutara tanto el evento capturado como la rutina por defecto. Se os ocurre alguna solución a este comportamiento tan extraño?
OBSERVACION: Este hecho solo ocurre si cambio el StringGrid.DrawingStyle a gdsGradient.

Última edición por adrall fecha: 21-06-2011 a las 12:10:21.
Responder Con Cita
Respuesta



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

Temas Similares
Tema Autor Foro Respuestas Último mensaje
alinear a la derecha texto de un stringgrid ctronx Varios 10 07-09-2007 21:54:59
alinear texto en el pdf dimitri PHP 2 23-05-2007 18:28:01
Alinear texto de un label Tecnic2 OOP 2 15-02-2005 16:42:39
Alinear Texto a derecha jollodel Varios 1 05-08-2004 13:33:26
Alinear texto de Tedit cisterpe OOP 2 11-09-2003 13:00:36


La franja horaria es GMT +2. Ahora son las 10:47:27.


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