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

Cell size of MSHFlexgrid

Status
Not open for further replies.

thornmastr

Programmer
Feb 2, 2002
1,337
US
I have a table of relationships viewed within an MSHFlexgrid. The maximum size of a record in this table is 75 characters. I notice that most of these values fit quite nicely into the cell size allocated by the flex grid.

Of course, there are a few which look slightly truncated and which do not fit into the size restrictions of the cell.

I know there is a way to determine the maximum cell size and then set the size of the current cell to that max width. For my needs, I think that is a bit of overkill. Is there not some property of the flexgrid that I can set as the cell size width for every cell (In this case there is only one).

What I am looking for is simplicity. Failing that and the only way to do this is programmatically, is there a way to set the width of all cells?

I suspect I am looking at this through jaded eyes and there is something very simple I have not found. And yes, I did search both the archives of this group and also google. There are certainly methods to find the max cell size, but again, this is far more punch than I really need. Since the maximum string size is 75 characters, that is the exact cell size I want.

Any insights and suggestions are most appreciated.


Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@earthlink.net
 
The easiest way would be to do it through code. You can place this in the form load event.

Dim i As Integer

For i = 0 To MSFlexGrid1.Cols - 1
MSFlexGrid1.Col = i
MSFlexGrid1.ColWidth(i) = 1000
Next i

1000 is the width of the column in Twips so you may have to do some trial and error testing to find the width that you want.



Thanks and Good Luck!

zemp
 
Zemp,

Thank you so much for the prompt reply. It worked very nicely and once I played with the twips (I settled on 2000) everything fell into place.

Again, thank you.

Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@earthlink.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top