Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autofit Cell sizes to Fit Data in a flexgrid. 1

Status
Not open for further replies.

Stainnd

Programmer
Jul 9, 2001
65
US
I need a flexgrid to have certain set widths for each column, and then to auto-set the row height so that all the data fits in each cell w/o the user having to re-size everything by hand. Thanks
-Mike
 
This will work for your width:

do this for as many columns as you have.
With FlexGrid
.ColWidth(0) = .Width * 0.20 ''(% of total width of grid)
.ColWidth(1) = .Width * 0.45
.ColWidth(2) = .Width * 0.15
.ColWidth(3) = .Width * 0.20
End With

As far as the height, do you want the row height to grow as the amount of data grows?
 
Well sort of. But this part of my program opens databases more than edits them. So basically, when you open a database, or i guess when u input data, the row height changes so that you can see all the data at once. The purpose is that I eventually wanna print the info, and if it prints, the person should be able to see all the data. follow me? So to answer your question, yes. All the cells will be wordwrapped, and since there are set column widths, the height of the rows will grow as the amount of data grows.
Thanks for the first column part.
-Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top