adebuigny
10-06-2000, 12:42 PM
Greetings;
Does anyone know of a way to set the width of each cell in the MSFlex grid programatically? The colwidth property is only able to return the current width. I'd like to be able to have differing widths for my data without making the user set them themselves.
BillSoo
10-06-2000, 12:51 PM
I can set the column widths just fine using the .colwidth property. What version of VB are you using?
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
BillSoo
10-06-2000, 01:55 PM
Well...it should still work. But I don't have much experience with VB5.
Try starting a new project. Add the flexgrid component to your tool bar. Add a flexgrid to a form. Then set the column width in the form load event like:
private sub form_load()
msflexgrid1.columnwidth(0) = 100
end sub
When you run the program, the 1st column should be a lot thinner than the 2nd.
If this works, then your project must have some property set that disables colwidths. If it does not work, then I guess it's a problem with the VB5 version of the flexgrid.
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
adebuigny
10-06-2000, 02:13 PM
Actually, that does work. It seems I assumed that it worked the same as the .row property. I assumed I could do this
grid.col = 0
grid.row - 0
grid.colwidth = 1200
I slapped my forehead just now when I realized that colwidth would affect every row, and every column, thus it needs an index. It can't assume the currently active index, as .row and .col do.
Thanks for the assist.