Setting Column Width Properties
Author Message
Setting Column Width Properties

Help list twips as 1 twip = 1/20 of a point or about 1440 twips to a
logical inch. If you know your CPI take len(astring)*CPI/1440.

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

Sun, 07 Nov 1999 03:00:00 GMT
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.

Mon, 08 Nov 1999 03:00:00 GMT
Setting Column Width Properties

I have use the following formula to create a ColWidth
Grid1.ColWidth = 1.2 * Textwidth(Grid1.Text)

or
x = "XXXXXXXXX"
Grid1.ColWidth = 1.2 * Len(x)
HTH

--
[Henri at]

: Help list twips as 1 twip = 1/20 of a point or about 1440 twips to a
: logical inch. If you know your CPI take len(astring)*CPI/1440.
: > 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
:

Mon, 08 Nov 1999 03:00:00 GMT

 Page 1 of 1 [ 5 post ]

Relevant Pages