Drag and drop/Move in Visual Basic

I was wondering if someone is willing to share me a script for visual basic that allows me to drag and drop my skin.
I created the skin for an application written in visual basic but because its a 'custom shape' it dasn't have an title bar.
This is why I want a script so I can drag it when I click on it with left mouseclick.
I already created something myself however because of the fact that my custom shape has some trancparancy in it it went laggy when I dragged it.

Let me know if you can help me out, anything is welcome
Thanks
1,401 views 2 replies
Reply #1 Top
Hmmm as long as it's not .NET version, this will work:

Public Declare Function ReleaseCapture Lib "user32" () As Long
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long
Public Const HTCAPTION = 2
Public Const WM_NCLBUTTONDOWN = &HA1

Private Sub Form_Mousedown(Button As Integer, Shift As Integer, X As Single, y As Single)
If Button = 1 Then ' Checking for Left Button only
Dim ReturnVal As Long
X = ReleaseCapture
ReturnVal = SendMessage(hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0)
End If
If Button = 2 Then PopupMenu Form1.Filey
End Sub

That's how I did mine.
Reply #2 Top
its visual basic 6... but well, its worth a try not? thanks