Shrinking font in Report Text Box

K

Keith

I have strings of varying length that I need to display in the same text box,
so I would like to be able to shrink the text if it would otherwise be
truncated. I've read other, similar posts but still have a question. It
seems that Lebans AutoSizeFont is the right module for me to download
(http://www.lebans.com/autosizefont.htm), but having done that, I'm not sure
how to "apply" it to the text box in question. I've got no experience using
modules. Could someone walk me through it?

Thanks,
Keith
 
M

Marshall Barton

Keith said:
I have strings of varying length that I need to display in the same text box,
so I would like to be able to shrink the text if it would otherwise be
truncated. I've read other, similar posts but still have a question. It
seems that Lebans AutoSizeFont is the right module for me to download
(http://www.lebans.com/autosizefont.htm), but having done that, I'm not sure
how to "apply" it to the text box in question. I've got no experience using
modules.


Study the example so you can see how it works. Then import
(File menu) the modTextHeightWidth module into your project.

Now you can add code to the Format event of the section that
contains the text box with the text. Your code should be
fairly similar to some of the code in the examples. Here's
some air code with the general idea:

Dim intFS As Integer

For intFS = 12 To 6 Step -1
thetextbox.FontSize = intFS
If fTextHeight(thetextbox) < thetextbox.Height - 20 _
And fTextWidth(thetextbox) < thetextbox.Width - 20 _
Then Exit For
Next intFS
 

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