Friday, February 22, 2008

How do I resize my text box to fit my text?

You can set the Can Grow property of your text box to Yes all you like, it won't grow on your form when it's displayed. Can Grow only applies when a form or report is printed. So how do you make your text box adjust its size to exactly match the amount of text you're displaying?

Take a look at TextHeightWidth.zip on Stephen Lebans' site. It's actually pretty easy to implement and allows you to find out how big your text really is and to adjust the text box (or combo box or list box) accordingly.

No comments: