如何固定最底下一行,滚动条拉动的时候,还显示固定的一行

解决方案 »

  1.   

    简单说吧, msf和mshf都不行。
    有别的开发的可以,如vsf
      

  2.   

    用2个MSHFlexGrid实现,下面的MSHFlexGrid只显示合计值
      

  3.   

    最头痛的事,如何使两个MSHFlexGrid表格对齐????????????
      

  4.   

    vsflex Grid可以实现,不过需要收费
      

  5.   

    关注这个帖子.
    另外对你帖图比较感兴趣.http://www.2ylighting.com/About.asp这是灯具厂的网站,你如何传上去的.因为,我发帖子需要有贴图,不好解决,比较头疼.
      

  6.   


    为你做了个mshflexgrid的最底一行固定行的例子,复制了去测试一下,可以举一反三的再增加功能。Private Sub Form_Load()
       
       With MSHFlexGrid1
           .Rows = 14: .Cols = 8
           .Move 0, 0
            
            Dim i As Integer, j As Integer, he As String, r As Integer, N As Integer
           .FixedCols = 1: .FixedRows = 1
            he = "|^xxx1|^xxx2|^xxx3|^xxx4|^xxx5|^xxx6|^xxx7|^xxx8"
           .FormatString = he
           .RowHeight(-1) = 400: .ColWidth(-1) = 800: .ColWidth(0) = 200
           .Height = .RowHeight(1) * 5 + 290 + 20
           .Width = .ColWidth(1) * (.Cols - 2) + 490
            
            For i = 1 To .Rows - 2
                For j = 1 To .Cols - 1
                    If j = 1 Then
                      .TextMatrix(i, j) = "name" & i
                    Else
                      .TextMatrix(i, j) = i + j
                    End If
                Next
            Next
           .Row = i: .Col = 1: .Text = "合计"
            For j = 1 To .Cols - 1
                If j > 1 Then
                   For r = 1 To .Rows - 2
                       N = N + .TextMatrix(r, j)
                   Next
                  .TextMatrix(r, j) = N
                End If
               .Col = j: .CellAlignment = 4
               .CellBackColor = &H80FFFF:
            Next
           .RowPosition(i) = (.Height - 290) \ .RowHeight(1) - 1
            h = (.Height - 290) \ .RowHeight(1) - 1
      End With
      
      
    End SubPrivate Sub MSHFlexGrid1_Scroll()
       With MSHFlexGrid1
           .RowPosition(h) = .TopRow + 3
            h = .TopRow + 3
       End WithEnd Sub
      

  7.   

    为你做了个mshflexgrid的最底一行固定行的例子,复制了去测试一下,可以举一反三的再增加功能。Dim h As IntegerPrivate Sub Form_Load()
       
       With MSHFlexGrid1
           .Rows = 14: .Cols = 8
           .Move 0, 0
            
            Dim i As Integer, j As Integer, he As String, r As Integer, N As Integer
           .FixedCols = 1: .FixedRows = 1
            he = "|^xxx1|^xxx2|^xxx3|^xxx4|^xxx5|^xxx6|^xxx7|^xxx8"
           .FormatString = he
           .RowHeight(-1) = 400: .ColWidth(-1) = 800: .ColWidth(0) = 200
           .Height = .RowHeight(1) * 5 + 290 + 20
           .Width = .ColWidth(1) * (.Cols - 2) + 490
            
            For i = 1 To .Rows - 2
                For j = 1 To .Cols - 1
                    If j = 1 Then
                      .TextMatrix(i, j) = "name" & i
                    Else
                      .TextMatrix(i, j) = i + j
                    End If
                Next
            Next
           .Row = i: .Col = 1: .Text = "合计"
            For j = 1 To .Cols - 1
                If j > 1 Then
                   For r = 1 To .Rows - 2
                       N = N + .TextMatrix(r, j)
                   Next
                  .TextMatrix(r, j) = N
                End If
               .Col = j: .CellAlignment = 4
               .CellBackColor = &H80FFFF:
            Next
           .RowPosition(i) = (.Height - 290) \ .RowHeight(1) - 1
            h = (.Height - 290) \ .RowHeight(1) - 1
      End With
      
      
    End SubPrivate Sub MSHFlexGrid1_Scroll()
       With MSHFlexGrid1
           .RowPosition(h) = .TopRow + 3
            h = .TopRow + 3
       End WithEnd Sub
      

  8.   

    这个问题很简单,第二个MSHFlexGrid对应的列宽可以指定,也可以指定表结构同第一个MSHFlexGrid的,只不过记录为空而已.如下边所示,表中的id不可能>90000000,实现结构一样却没有数据,再并上一条合计数据,合计值可以实现计算好替换了即可
    rs.Open "select 字段1,字段2,字段3 from biao where id>90000000 union select '合计',100,300 ", db, adOpenKeyset, adLockOptimistic
    MSHFlexGrid1.DataSource = rs
    就lz的这个问题而言,还可以只用一个MSHFlexGrid控件,sql语句照样union一条合计数据即可