Ver Mensaje Individual
  #4  
Antiguo 25-04-2006
Avatar de Lepe
[Lepe] Lepe is offline
Miembro Premium
 
Registrado: may 2003
Posts: 7.424
Reputación: 28
Lepe Va por buen camino
Código Delphi [-]
unit LpFont;

interface

uses Graphics,sysutils, types,windows;


function FontHeight(const Fuente:TFont;const Texto:string):Integer;
function FontWidth(const Fuente:TFont;const Texto:string):Integer;

implementation

uses shellapi;


function FontWidth(const Fuente:TFont;const Texto:string):Integer;
var c:TCanvas;
begin
  try
    c:= TCanvas.Create;
    c.Handle := GetDC(0);

    c.Font.Assign(Fuente);
    Result := c.TextWidth(Texto);
  finally
    FreeAndNil(c);
  end;
end;

function FontHeight(const Fuente:TFont;const Texto:string):Integer;
var c:TCanvas;
begin
  try
    c:= TCanvas.Create;
    c.Handle := GetDC(0);

    c.Font.Assign(Fuente);
    Result := c.TextHeight(Texto);
  finally
    FreeAndNil(c);
  end;
end;
asignas el tamaño a los qrlabels y despues llamas a estas funciones para ver cuanto ocupan, así le das el tamaño.
Código Delphi [-]
  QRLABEL4.Font.Size := 23;
  QRLABEL4.Height := lpfont.FontHeight(QRLabel4.Font,qrlabel4.caption);
Puede que haya otra forma más fácil, pero no la he probado, esta forma la tenía más a mano .

Saludos
__________________
Si usted entendió mi comentario, contácteme y gustosamente,
se lo volveré a explicar hasta que no lo entienda, Gracias.

Última edición por Lepe fecha: 26-04-2006 a las 08:38:17.
Responder Con Cita