Firstly, that's VB, not C# - it's important to tag your question correctly!
Second, if it works for a Button then it should work for a UserControl.
The best way to do it is to replace the fixed dependency on Button1 with a generic Control, and use the
sender
parameter to identify the control that is involved:
Private Sub Control_MouseMove(sender As System.Object, e As System.Windows.Forms.MouseEventArgs)
Dim c As Control = TryCast(sender, Control)
If a = True Then
c.Left = Control.MousePosition.X - Me.Left - 10
c.Top = Control.MousePosition.Y - Me.Top - 40
End If
End Sub
And use that to handle your events.