maxlength on textbox

R

ranswrt

I have a problem with the maxlength in a textbox. I have the maxlength set
to 27 characters. The problem is some characters are wider than others.
Some of the strings are wider than the cell that I am putting them in. Is
there a way to limit the width of a string not by the number of characters,
but the actual width of the string?
Thanks
 
M

macropod

Hi ranswrt

The easiest way would be to store the width of the column the string is to go into as a variable, insert your string into the
column, do an autofit of the column width, test whether the new width is less than or equal to the original value, then reset the
column width to its original value. If the autofit width was larger tan the original value, the string was too wide.
 

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