How to block mouse scroll in Datagridview?

Asked

Viewed 190 times

1

To disable Scrollbar on a Vb.net grid, there is a problem and I want to block to fix it.

1 answer

1


You can do this at the event MouseWheel. Take 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
  • What you posted is in C#, I’m not able to convert, could you help me? wanted in Vb.net even.

  • @marcelo_drummer I didn’t see that it was Vb . NET, but I already fixed it.

  • returned this error to me: Error 8 Method 'Private Sub dgvApartments_OnMouseWheel(and As System.Windows.Forms.Mouseeventargs)' cannot Handle Event 'Public Event Mousewheel(Sender As Object, and As System.Windows.Forms.Mouseeventargs)' because they do not have a compatible Signature. C: Users Marcelo Dropbox TCC in_hoteis frmQUARTOS.Vb 169 97 IN_HOTEIS

  • @marcelo_drummer I fixed it too =)

  • @marcelo_drummer It worked?

  • I am using a framework that is called metro framework, the programming is the same as standard dgv, did not work, you know the framework?

  • @marcelo_drummer I don’t know. Have you tried this in the standard DGV?

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.