How to get the Width of a changing Labels?
Hello
Delphi7, RB 7.04
In my report, i must change some Label.Captions, depending of the settings
of the user.
I did it in the OnCreate-Event in RAP.
But the Width-Property shows all the times the width of the old captions, no
matter if AutoSize is true or not.
How can i get the new width of a Label?
Depending on their new Width, i must calculate their new Left Position.
Thanks,
J?rgen
Delphi7, RB 7.04
In my report, i must change some Label.Captions, depending of the settings
of the user.
I did it in the OnCreate-Event in RAP.
But the Width-Property shows all the times the width of the old captions, no
matter if AutoSize is true or not.
How can i get the new width of a Label?
Depending on their new Width, i must calculate their new Left Position.
Thanks,
J?rgen
This discussion has been closed.
Comments
First, try using the OnDrawCommandCreate event to see if you can get the
actual width (in microns) of the label with the new caption. If this proves
to be too difficult, you may need to create a passthru function that
measures the width of a line of text. This can be done rather easily using
the TCanvas.TextWidth() routine in Delphi.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com