如题!

解决方案 »

  1.   

    Dim adoCnn As New adodb.Connection
     Dim adoCmm As New adodb.Command
     Dim adoRec As New adodb.Recordset
     
     adoCnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Program Files\Microsoft Visual Studio\VB98\NWIND.MDB;Persist Security Info=False" adoCmm.ActiveConnection = adoCnn
     adoCmm.CommandType = adCmdText
     adoCmm.CommandText = "select * from employees"
     Set adoRec = adoCmm.Execute
     Set MSHFlexGrid1.DataSource = adoRec
      

  2.   

    With MSHFlexGrid1
            .Rows = 10
            .Cols = 5
            For i = 1 To 3
                .TextMatrix(2, i) = "555"
                .TextMatrix(3, i) = "555"        Next
        End With
      

  3.   

    工程--->部件--->Microsoft Hierarchical FlexGrid Control 6.0
      

  4.   

    是如何添加MSHFlexGrid部件?
    ctrl+T,选择MSHFlexGrid
    然后lihonggen0(李洪根,用.NET,标准答案来了) ( ) 大哥的方法添加数据!
      

  5.   

    With Mfg_Djll_Detail
            .Redraw = False
            Row_Cnt = 0
            Do While Not Rs_Flex.EOF
                Row_Cnt = Row_Cnt + 1
                .Rows = Row_Cnt + 2
                .Row = Row_Cnt + 1
                .Col = 0
                .CellAlignment = flexAlignCenterCenter
                .Text = Row_Cnt
                For J = 1 To .Cols - 1
                    .Col = J
                    .CellAlignment = flexAlignCenterCenter
                    If IsNull(Rs_Flex.Fields(J - 1)) = True Then
                        .Text = ""
                    Else
                        .Text = Rs_Flex.Fields(J - 1)
                    End If
                Next J
                .Col = 17
                .CellForeColor = QBColor(7)
                Rs_Flex.MoveNext
            Loop
            .Redraw = True
        End With