Hola peladete cochinón, ¿Cómo se te va? Jejejeje. Mira, creo haber entendido lo que necesitas, pero no estoy muy seguro, como sea, ahà te va el código:
Esto va en un módulo (ya sabes... Menú Proyecto-->Agregar módulo)
Public Type POINTAPI
X As Long
Y As Long
End Type
Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Public Function MueveteCochinaY(Mbutton As Integer, FRM As Form, CRL As Control, FRMhasMenu As Boolean)
If Mbutton = 1 Then
Dim cursorPos As POINTAPI
GetCursorPos cursorPos
If FRMhasMenu = True Then
CRL.Top = (cursorPos.Y * Screen.TwipsPerPixelY - FRM.Top) - 725
Else
CRL.Top = (cursorPos.Y * Screen.TwipsPerPixelY - FRM.Top) - 500
End If
End If
End Function
Public Function MueveteCochinaX(Mbutton As Integer, FRM As Form, CRL As Control)
If Mbutton = 1 Then
Dim cursorPos As POINTAPI
GetCursorPos cursorPos
CRL.Left = (cursorPos.X * Screen.TwipsPerPixelX - FRM.Left) - 1400
End If
End Function
Esto va en el formulario; tienes que agregar un CommandButton (botón) y debe llamarse Command1
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
MueveteCochinaY Button, Me, Command1, False
MueveteCochinaX Button, Me, Command1
End Sub
Espero que sea eso lo que necesitas peladete. Au revoir.