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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSHFlexGrid Column Width?

Status
Not open for further replies.

rukk

Programmer
Dec 29, 2003
38
US
How to fix the Column width in MSHFlex grid?
 
something like this what you looking for ?

MSHFlexGrid1.ColWidth(0) = 0
MSHFlexGrid1.ColWidth(1)=MSHFlexGrid1.width * .10 ' means 10 % of grid
MSHFlexGrid1.ColWidth(2)=MSHFlexGrid1.width * .20 ' means 20 % of grid
MSHFlexGrid1.ColWidth(3)=MSHFlexGrid1.width * .30 ' means 30 % of grid
MSHFlexGrid1.ColWidth(4)=MSHFlexGrid1.width * .38 ' means 38 % of grid

will need to put each time grid is loaded
 
Thats a good example, but i don't know how many fields will be each time when it opens. Because the fields will vary like one time there can be 10 fields but next time there can be 50. So how to fix it with specific field number.
 
something kind of like this.

For x= 0 to rst.fields.count-1
MSHFlexGrid1.ColWidth(x)=MSHFlexGrid1.width / rst.fields.count
next x

But bear in mind if you have 50 fields the columns will get very narrow so would be best to limit the fields returned.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top