设置LeftCol属性可以滚动横向滚动跳

解决方案 »

  1.   

    因为有汉字,所以焦点向左或向右移动时则滚动条不会随之移动!只要:
    DataGrid1.MarqueeStyle = dbgHighlightCell
    焦点向左或向右移动时滚动条会随之移动
      

  2.   

    '向右:
    Private Sub Command1_Click()
    If DataGrid1.LeftCol < DataGrid1.Columns.Count - 1 Then
       DataGrid1.LeftCol = DataGrid1.LeftCol + 1
    End If
    End Sub
    '向左:
    Private Sub Command2_Click()
    If DataGrid1.LeftCol > 0 Then
       DataGrid1.LeftCol = DataGrid1.LeftCol - 1
    End If
    End Sub