How to auto fit font in some field

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

Guest

My report is contains 8 fields (table form), All field is size 12 tahoma
font. Sometimes data in somefields is larger than table size. How can I auto
decrease font to fit in those field ?
 
Nova said:
My report is contains 8 fields (table form), All field is size 12 tahoma
font. Sometimes data in somefields is larger than table size. How can I auto
decrease font to fit in those field ?


Use the fTextWidthHeight function at www.lebans.com

Dim intFS As Integer

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