Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
 
500MB 27GB Web Hosting - $9.95/Month
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitleDisplay a matrix in a FlexGrid control
KeywordsFlexGrid, matrix
CategoriesControls
 
Use the Rows and Cols properties to size the grid. Use TextMatrix to set the values in the grid.
 
Private Sub Form_Load()
Dim matrix(1 To 4, 1 To 2) As Single
Dim r As Integer
Dim c As Integer

    For r = 1 To UBound(matrix, 1)
        For c = 1 To UBound(matrix, 2)
            matrix(r, c) = Rnd * 100
        Next c
    Next r

    MSFlexGrid1.Rows = UBound(matrix, 1)
    MSFlexGrid1.Cols = UBound(matrix, 2)
    MSFlexGrid1.FixedCols = 0
    MSFlexGrid1.FixedRows = 0
    For r = 1 To UBound(matrix, 1)
        For c = 1 To UBound(matrix, 2)
            MSFlexGrid1.TextMatrix(r - 1, c - 1) = _
                Format$(matrix(r, c), "0.00")
        Next c
    Next r
End Sub
 
Formatted by Neil Crosby
 
 
Copyright © 1997-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated