A beginners query... I want to set up a generic function (see below) to set each column width on a Flexgrid in VB6.
At the moment it should pass the form name, control name and up to 10 values (width), then set each column to the appropriate value.
Please can someone help with how to concatenate variables which will successfully point at a control on a form,
e.g. strForm.strControl.ColWidth(2) =2000
Thanks in advance.
Function fncSetUpHFlexGridCols(strForm, strControl, intCol1, intCol2, intCol3, intCol4, intCol5, intCol6, intCol7, intCol8, intCol9, intCol10)
'Called With: fncSetUpHFlexGridCols("Form1", "MSHFlexGrid1", 1000, 1000, 2000, 1000, 500, 0, 0, 0, 0, 0)
Dim intSizes, i As Integer
intSizes = Array(intCol1, intCol2, intCol3, intCol4, intCol5, intCol6, intCol7, intCol8, intCol9, intCol10)
For i = 0 To 9
'Form1.MSHFlexGrid1.ColWidth(2) = 2000
strForm.strControl.ColWidth(2) = intSizes(i)
Next i
End Function
At the moment it should pass the form name, control name and up to 10 values (width), then set each column to the appropriate value.
Please can someone help with how to concatenate variables which will successfully point at a control on a form,
e.g. strForm.strControl.ColWidth(2) =2000
Thanks in advance.
Function fncSetUpHFlexGridCols(strForm, strControl, intCol1, intCol2, intCol3, intCol4, intCol5, intCol6, intCol7, intCol8, intCol9, intCol10)
'Called With: fncSetUpHFlexGridCols("Form1", "MSHFlexGrid1", 1000, 1000, 2000, 1000, 500, 0, 0, 0, 0, 0)
Dim intSizes, i As Integer
intSizes = Array(intCol1, intCol2, intCol3, intCol4, intCol5, intCol6, intCol7, intCol8, intCol9, intCol10)
For i = 0 To 9
'Form1.MSHFlexGrid1.ColWidth(2) = 2000
strForm.strControl.ColWidth(2) = intSizes(i)
Next i
End Function