vb.net 用上下左右键控制Grid滚动条

    Private Sub frmSalesGraph_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
        If e.KeyCode = Keys.Left OrElse e.KeyCode = Keys.Up Then
            Me.grdDetail.ActiveColScrollRegion.Position = 0
        ElseIf e.KeyCode = Keys.Right OrElse e.KeyCode = Keys.Down Then
            Me.grdDetail.ActiveColScrollRegion.Position = grdDetail.ActiveColScrollRegion.Range
        End If
    End Sub

你可能感兴趣的:(object,VB.NET)