' Copy the array data into the grid.
Private Sub CopyArrayToGrid(ByRef m_ArrayData() As String, _
ByVal grd As MSFlexGrid)
Dim rmin As Integer
Dim cmin As Integer
Dim rmax As Integer
Dim cmax As Integer
Dim r As Integer
Dim c As Integer
rmin = LBound(m_ArrayData, 1)
rmax = UBound(m_ArrayData, 1)
cmin = LBound(m_ArrayData, 2)
cmax = UBound(m_ArrayData, 2)
grd.Rows = rmax - rmin + 1
grd.Cols = cmax - cmin + 1
grd.FixedCols = 0
grd.FixedRows = 0
For r = rmin To rmax
For c = cmin To cmax
grd.TextMatrix(r - rmin, c - cmin) = _
m_ArrayData(r, c)
Next c
Next r
End Sub
|