I have a tppline above a tpplabel, the tpplabel is taRightJustified and autosize, I want the tppline.left = tpplabel.left. I have try this in band.beforeprint but it fail, so any method to left align the tppline and the tpplabel under it?
With your label set to Autosize, the width of the control is not calculated until the text is printed. Setting the left offset of the line in the Band.BeforePrint is too early. You will need to get the text in the Band.BeforePrint and run it through the TCanvas.TextWidth routine to find out the length. Then using this number and the right offset of the text, assign the left offset of the line.
Comments
With your label set to Autosize, the width of the control is not calculated
until the text is printed. Setting the left offset of the line in the
Band.BeforePrint is too early. You will need to get the text in the
Band.BeforePrint and run it through the TCanvas.TextWidth routine to find
out the length. Then using this number and the right offset of the text,
assign the left offset of the line.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com