String length in twips

B

Bill

Is there a function that will calculate the twip length
of a string, given its font, weight and point size?
Like the length of the current string in a text box
control.
Thanks,
Bill
 
B

Bill

I did find what appears to be the functionality I'm
looking for at "Lebans".... "TextHeightWidth". If
there's something else, though I don't know what
it would be given Steven's usual supreme efforts,
please let me know.
Thanks,
Bill
 
M

Marshall Barton

Bill said:
Is there a function that will calculate the twip length
of a string, given its font, weight and point size?
Like the length of the current string in a text box
control.


AFAIK, there are only two possible ways to do that.

If you are certain that the text will always display on one
line in the text box, then the report TextWidth method can
be used. You must first set the report's FontName,
FontSize, FontBold, etc. properties.

Stephen's TextHeightWidth function is way more flexible and
easier to use.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top