Im working on a project in VB6 using ms flexgrid. when the program loads all the columns come up pushed all the way over to the left making the whole thing look like crap.
anybody know how to size the columns at runtime??
TIA
Printable View
Im working on a project in VB6 using ms flexgrid. when the program loads all the columns come up pushed all the way over to the left making the whole thing look like crap.
anybody know how to size the columns at runtime??
TIA
Hey Hey
I believe this is what you are asking about, but u can correct me if I'm wrong.. and I'll try and provide a solution for your problem.
This depends on what FlexGrid you are using..... if you use the MS Hierarchical FlexGrid.. it should work fine..
MSFlexGrid.ColWidth(X) = (width)
where X is the Column you are addressing.. (0, 1, 2, 3......... N)
thanks for the reply!
Its 'microsoft FlexGrid Control 6.0' found under project>>components
I've tried many ways to make it work:
Private Sub Form_Load()
Dim ColWidth As Long
Dim Field1
Dim Field2
Dim Field3
MSFlexGrid1.ColWidth(Field1) = 500
MSFlexGrid1.ColWidth(Field2) = 200
MSFlexGrid1.ColWidth(Field3) = 5000
End Sub
i keep fooling with this 'MSFlexGrid.ColWidth(X) = (Width)' but i kept getting "object not defined so i dimmed everything
all the change i do just seem to affect field1 and the column i want to affect is field2
Try using just numbers.. 0,1,2 and so on.. deal with it like it's an array...
your other option is to use:
Microsoft Hierarchical FlexGrid Control 6.0 found in the same spot.. this one will definately accept ColWidth....
HTRegz your da man!
Private Sub Form_Load()
MSFlexGrid1.ColWidth(1) = 3200
End Sub
this is working with the MSFlex grid as well as MSHFlexGrid
but it looks great now, thanks again