TextArray Property (ModHFGrid) Example

The following example shows how to calculate cellindex by defining a function.

' Calculate index for use with TextArray property.
Function faIndex(row As Integer, col As Integer) As Long
faIndex =row * ModHFGrid1.Cols + col
End Function
Sub Form_Load()
Dim i as Integer
' Fill ModHFGrid with data using TextArray property.
For i =ModHFGrid1.FixedRows to ModHFGrid1.Rows - 1
' ** column 1
ModHFGrid1.TextArray(faIndex(i, 1)) =RandomName()
' Column 2.
ModHFGrid1.TextArray(faIndex(i, 2)) =RandomNumber()
Next