
Setting Column Width Properties
Quote:
>I am trying to set the column heading widths on a grid I am making.I used
>the Len funtion to get the length of the string to go in the cellbut I
>discovered that the colwidth property reads in twips. How do I convert
>to character lengths to set the colwidth property?Sincerely,Darrick Leier
Put an invisible label into your for, with autosize = true. Set the font
properties to the same as your grid.
Now, assign the text to this label, and then just read the label's
width.
Another way is to use TextWidth, but again, the font properties of the
control your using for this must be the same as your grid's. You may use
the form, very good if you don't print to the form itself, or else you
need an extra picture box:
w = Me.TextWidth("some text")
or
w = Picture1.TextWidth("some text")
Gent (Ghent, Gand),
Belgium,
Europe,
3rd planet from the sun.