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  
 
 [ 5 post ] 

 Relevant Pages 

1. Setting datagrid column width sets width of toplevel!!

2. Set Grid width to sum of Column Widths

3. Setting Usercontrol (ocx) width at runtime wider than Width property of usercontrol

4. Setting Font and Column Width in Excel from Access

5. Set column widths in code?

6. setting column width

7. Setting Table Column Widths in Word 2000

8. DataGrid Setting Width of Columns to Fit Autofit.

9. Set column width of a datagrid

10. How do I Set Datagrid Column widths?

11. how to set the Column Width in dataGrid?

12. HELP :Setting Column width in a DBGrid ?

 

 
Powered by phpBB® Forum Software