How do I lock the mouse scroll in the DataGridView?

1

How to disable ScrollBar in a grid in vb.net, a problem is occurring and I want to block it to fix this.

    
asked by anonymous 16.05.2015 / 22:04

1 answer

1

You can do this in the MouseWheel event. . Here's an example:

Private Sub DataGridView1_OnMouseWheel(sender As Object, e As System.Windows.Forms.MouseEventArgs) 
 Handles DataGridView1.MouseWheel
    Dim mwe As HandledMouseEventArgs = DirectCast(e, HandledMouseEventArgs)
    mwe.Handled = True
End Sub
    
16.05.2015 / 22:18