Drag and drop/Move in Visual Basic

Monday, December 1, 2003 by Styl-X Design | Discussion: WinCustomize Talk

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
XX
Reply #1 Monday, December 1, 2003 7:24 PM
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.
Styl-X Design
Reply #2 Tuesday, December 2, 2003 3:36 AM
its visual basic 6... but well, its worth a try not? thanks

Please login to comment and/or vote for this skin.

Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:

  • Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
  • Access to a great community, with a massive database of many, many areas of interest.
  • Access to contests & subscription offers like exclusive emails.
  • It's simple, and FREE!



web-wc01