我在窗体上放两个表格,一个用于显示明细,另一个用于显示合计。
当明细表水平滚动时,合计表一同滚动,保证每列都是对齐的,就象是一个表一样,如何实现呢?
请教高手。

解决方案 »

  1.   

    Private Sub Timer1_Timer()
       Me.DataGrid2.LeftCol = Me.DataGrid1.LeftCol
    End Sub
      

  2.   

    Private Sub Timer1_Timer()
    Me.DataGrid2.LeftCol = Me.DataGrid1.LeftCol
    End Sub
    ==================
    谢谢:这样要加入timer控件,是不是很费资源呀!
    请教。
    大家帮我顶呀!
      

  3.   

    Private Sub DataGrid1_Scroll(Cancel As Integer)
      Me.DataGrid2.LeftCol = Me.DataGrid1.LeftCol
    End Sub