-
Feb 21st, 2005, 01:42 PM
#1
Thread Starter
New Member
pixels, twips and things
Im trying to dump the contents of an MSFlexGrid into an excel sheet and set the widths of the excel columns to be the same as the flex grid. I have a couple problems.
1. I can't find the units of measurement used by a flex grid.
2. Excel uses a unit of measurement that is the number of average sized characters that can fit in a cell. Well how do i convert from pixels, or whatever the flex grid is using, to this weird system?
Thanks
-
Feb 21st, 2005, 01:49 PM
#2
Re: pixels, twips and things
Originally Posted by jsteel
Im trying to dump the contents of an MSFlexGrid into an excel sheet and set the widths of the excel columns to be the same as the flex grid. I have a couple problems.
1. I can't find the units of measurement used by a flex grid.
2. Excel uses a unit of measurement that is the number of average sized characters that can fit in a cell. Well how do i convert from pixels, or whatever the flex grid is using, to this weird system?
Thanks
The flex grid uses TWIPS (1/20 of a printer point).
72 points per inch
20 twips to a point
1440 twips per inch
The FLEXGRID has a .TEXTWIDTH property that will give you the TWIP size of any string you pass it.
I'm not sure how EXCEL does the average - you could pass each character - A to Z to .TEXTWIDTH and strike an average in VB - not sure if that is a match though.
-
Feb 21st, 2005, 01:52 PM
#3
Re: pixels, twips and things
BTW - Welcome to the forum!
-
Feb 21st, 2005, 01:54 PM
#4
Re: pixels, twips and things
szlamany beat me to the different scales, but here's the what you need for Excel (from Excel's help for ColumnWidth):
"Use the Width property to return the width of a column in points."
As 1 point = 20 twips, you just need to divide the Grid sizes by 20.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|