<control>.locationChanged ??

  • Thread starter Thread starter KS
  • Start date Start date
K

KS

How can I find out how much the location chanced ?

How does the arguments Sender or e show me that ?

KS, Denmark
 
Hi KS,
Have a look at this,

Not as a direct answer on your question, but as a sample to help you to
understand the movement of the cursor and how to catch that.

Cor

\\\
Private Sub myControl_MouseDown(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles myControl.MouseDown
swMousedown = True
MyFunction.Mousedown(myControl.PointToScreen(New Point(0, 0)))
End Sub
Private Sub myControl_MouseUp(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles myControl.MouseUp
swMousedown = False
End Sub
Private Sub myControl_MouseMove(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles myControl.MouseMove
Static LastCursor As Point
Dim NowCursor As Point = New Point(Cursor.Position.X, Cursor.Position.Y)
If Point.op_Inequality(NowCursor, LastCursor) and swMousedown Then
'doSomething
End If
LastCursor = Cursor.Position
End Sub
///
 
KS,

To give you a direct answer to your second question
The sender is the object that send the event in your example probably
your button and than is something as
me.button1.location the same as
directcast(sender,button).location

The e is the event and for that you have to look at the event argument of
the event.

I hope this helps,

Cor
 
Thanks for your answer but shall I then conclude that
the arguments Sender/e NOT can tell me how much
the location changed ?

There are many ways to calculate the movements but I
and I would expect that Sender/e could tell me that.

KS, Denmark
 
Hi KS,
See my other message I did made it in almost the same time, but I did
forget to push the button to send I saw so it is delayed.
Cor
 
Back
Top