想要把一个集合里的内容,直接绑给MSFlexgrid,行不行呀,
我是这样做的,我自己看着都不对劲,但我想不出该怎么做?
    For i = 1 To scrCol.Count
         Flx1.DataSource = scrCol.Item(i)
    Next i

解决方案 »

  1.   

    只有一个一个的往grid里面填了!
    For i = 1 To scrCol.Count
       Flx1.TextMatrix(i,1)= = scrCol.Item(i)
    Next i
      

  2.   

    对了,关于msflexgrid来说,最左上角的那个网格是(0,0),包括标题栏!!如果没有第一列横坐标栏,则第一个可用的网个则是(0,1)同理,没有第一行的msflexgrid,第一个可用的是(1,0)如果都横竖标题栏都没有,那么第一个可用的就是(0,0)啦~~!
      

  3.   

    Public Sub ClipToGrid(msfGrid As MSFlexGrid, strClip As String, intRows As Integer, intCols As Integer)
        
        With msfGrid
            .Rows = .FixedRows
            If intRows > .FixedRows Then
                If .Redraw Then .Redraw = False
                .Cols = intCols
                .Rows = intRows
                .Col = 0 '.FixedCols
                .Row = .FixedRows
                .ColSel = .Cols - 1
                .RowSel = .Rows - 1
                .Clip = strClip
                .Col = 0 '.FixedCols
                .Row = .FixedRows
                .Redraw = True
                .RowHeightMin = 300
            End If
        End With
    End Sub
    msfgrid.formatstring = "<A" + vbtab + "<B" + vbtab + "<C"'例如
    for i = 1 to 10
    strClip = strclip & "A" & i & vbtab & "B" & i & vbtab & "C" & i & vbcr
    next i intRows = 10   '10行
    intCols = 3    '3列ClipToGrid msfgrid, strclip, intRows, intCols