detect if my pplabel has resized during a wordwrap?
Hi,
Im using Delphi 7 and ReportBuilder 10.02. Is it possible to detect if my
pplabel automatically expand from its original size when it encounters huge
amount of text rather than using length(var)?
Because right now im using this piece of code
pplabelonprint event
if length(pplabel.caption) < 20 then pplabel.height := .2
thanks a lot..
Im using Delphi 7 and ReportBuilder 10.02. Is it possible to detect if my
pplabel automatically expand from its original size when it encounters huge
amount of text rather than using length(var)?
Because right now im using this piece of code
pplabelonprint event
if length(pplabel.caption) < 20 then pplabel.height := .2
thanks a lot..
This discussion has been closed.
Comments
If you have access to the text before the label is resized, you can use the
TCanvas.TextWidth routine to find the width. For instance, you could create
a TBitmap and use its Canvas to do this.
lBitmap := TBitmap.Create;
lBitmap.Canvas.Font := lFont;
liWidth := lBitmap.Canvas.TextWidth(lsMyText);
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com