I tried to use this code in the form:
AddHandler MyControl.MouseDown, AddressOf StartDrag
This wont give me an error, but it doesn’t happen anything when I mouse down on the Control.
the same doesn’t work if I put it in the user control.
Private Sub StartDrag(ByVal sender As Object, ByVal e As MouseEventArgs)
Dim Box = CType(sender, Control)
Box.Tag = New DragInfo(Form.MousePosition, Box.Location)
End Sub
I’ve just built a user control and added it to a form. Here is my code:
This works fine – the messagebox appears on the screen when I press the mouse button down. I have no code at all running in the user control, so no worries about having to call RaiseEvent.