Can any body tell me why am I getting a mouse move event with every mouse click event. I am having a simple form without any control on it.
I have two handlers one for mouse move and one for mouse click. I am printing a
Console.Writeline("Mouse Clicked") in mouse click handler and
Console.Writeline("Mouse Moved") in mouse move handler.
But whenever I click on the form follwoing lines are printed
Why is that? Please help me.
ADAdministrator Syncfusion Team October 23, 2002 02:47 AM
I don't know why Microsoft is firing a MouseMove after a click, whether its is by design or just a bug.
But you can ignore it in your code by setting a flag in the click handler and testing it in the mousemove handler.
Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
If bIgnoreMouseMove Then
bIgnoreMouseMove = False
Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Click
bIgnoreMouseMove = True