Share via


TextArray Property (ModHFGrid)

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Returns or sets the text content of an arbitrary cell.

Syntax

object.TextArray(cellindex) [=string]

The TextArray property syntax has these parts:

Part Description
object An object expression that evaluates to the ModHFGrid Control object.
cellindex Integer. A numeric expression that specifies which cell to read or write. See Remarks.
string A string expression containing the contents of an arbitrary cell.

Remarks

This property makes it possible for you to set or retrieve the contents of a cell without changing the Row and Col properties.

The cellindex argument determines which cell to use. It is calculated by multiplying the preferred row by the Cols property and adding the preferred column. The clearest and most convenient way to calculate cellindex is to define a function to do it.

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

See Also

Text Property (ModHFGrid) | TextMatrix Property (ModHFGrid) | ModHFGrid Control