El source para poder mover objetos es el siguiente:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal iparam As Long) As Long
Private Declare Sub ReleaseCapture Lib "user32" ()
Private Function Moverme(Form1 As Form)
ReleaseCapture
Call SendMessage(Form1.hwnd, &HA1, 2, 0&)
End Function
Por ejemplo, para mover cualquier parte del form sin ningun objeto sería este el code:
Private Sub Form_Mousemove(Button As Integer, shift As Integer, x As Single, y As Single)
Call Moverme(Me)
End Sub
Y para mover un label o yo que se, un shape o lo que sea:
Private Sub Label1_Mousemove(Button As Integer, shift As Integer, x As Single, y As Single)
Call Moverme(Me)
End Sub
Es sencillo y muy útil, espero que lo disfruteis.
UN saludo
1 comentarios:
muchisimas gracias
Publicar un comentario