Click to See Complete Forum and Search --> : Centering Multiple Line Text


Hoagie
July 17th, 2001, 04:47 PM
I have this current chunk of code:


xProper = (Preview.ScaleWidth - TextWidth(Subtitle.Text)) / 2
yProper = (Preview.ScaleHeight - TextHeight(Subtitle.Text)) / 2

Preview.CurrentX = xProper
Preview.CurrentY = yProper
Preview.print Subtitle.Text




... where 'Subtitle' is a multiline text box.

If I put a single line in, it works great! But as soon as I put in a second line the alignment starts to fail. The first line will appear center, but subsequent lines appear on the right border.

I figure I could parse the text based on a newline, but it seems like there should be an easier way.

Many thanks for any help!

Hoag

Robert Moy
July 17th, 2001, 07:10 PM
Hello:
Before you run the program, I must set MultiLine to true and Alignment to 2 in Properties

Good Luck