Resize text to fit control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Is it possible to have text automatically resize to fit a text box rather
than the have the Text box grow or shrink

Thanks Sean
 
Hi,

Is it possible to have text automatically resize to fit a text box rather
than the have the Text box grow or shrink

Thanks Sean


______________________________________________________
| No. |
______________________________________________________


________________
| Not so far as |
________________

<g>

Seriously, this could be VERY difficult. Most fonts are variable
sizes; just counting letters doesn't get you the width accurately,
you'll need a table identifying the width in twips of a "M" and a
"l", and some rather tricky code to add them up, include the correct
kerning, and then resize the font to fit the textbox.

And as my facetious examples indicate, the result might be unreadably
spread out or jammed together if you did so in any case!

John W. Vinson[MVP]
 
See:
http://www.lebans.com/autosizefont.htm
AutoSizeFont.zip is a database containing a function to automatically resize
a Control's Font to fit the current record's contents. Works in the Form's
Current and/or Change events.

Version 2: Updated to use the new ,more accurate, fTextHeight function.

Version 1: First Release
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Back
Top