MSFlexGrid - font metrics available for adjusting column widths?

  • Thread starter Thread starter MyndPhlyp
  • Start date Start date
M

MyndPhlyp

There doesn't appear to be a MSFlexGrid property to automatically adjust a
column width to fit the contents. It seems to take the column width from the
values placed in the fixed row (ala MSFlexGrid.FormatString). There also
doesn't appear to be a property to enable an "auto resize" if the user
double-clicks between column headings.

Is there a slick way (or even an API call or three) to determine the
displayed length of a string given the font name and size so that the column
width can be programmatically adjusted accordingly?
 
Please do not multipost but rather crosspost to your selected NG's at
one time.

See:
http://www.lebans.com/textwidth-height.htm
TextHeightWidth.zip is a replacement for the Report object's TextWidth
and TextHeight methods. It is multiline aware and can work in both
Report and Form views. Includes a sample report to show you how to
autosize individual controls with different formatting on the same line
to simulate RTF style text.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Stephen Lebans said:
Please do not multipost but rather crosspost to your selected NG's at
one time.

See:
http://www.lebans.com/textwidth-height.htm
TextHeightWidth.zip is a replacement for the Report object's TextWidth
and TextHeight methods. It is multiline aware and can work in both
Report and Form views. Includes a sample report to show you how to
autosize individual controls with different formatting on the same line
to simulate RTF style text.

Thanx. The other post was not intentional.
 
Back
Top