'向右: 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
DataGrid1.MarqueeStyle = dbgHighlightCell
焦点向左或向右移动时滚动条会随之移动
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