VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Just click on your form and Move it on your screen. Useful utility for the forms without title bar.

by JK Shersia (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 17th December 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Just click on your form and Move it on your screen. Useful utility for the forms without title bar.

API Declarations


Private Type POINTAPI
xx As Long
yy As Long
End Type
Private cuX As Integer, cuY As Integer
Private frmX As Integer, frmY As Integer
Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long


Rate Just click on your form and Move it on your screen. Useful utility for the forms without title bar.



MousePointer = 5
errX = 0
errY = 0
Dim co As POINTAPI
i = GetCursorPos(co)
frmX = Form1.Left
frmY = Form1.Top
cuX = co.xx * 15
cuY = co.yy * 15
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim co As POINTAPI
i = GetCursorPos(co)
If Button = 1 Then
errX = co.xx * 15 - cuX
errY = co.yy * 15 - cuY
Form1.Left = frmX + errX
Form1.Top = frmY + errY
End If
End Sub

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
MousePointer = 0

End Sub


Download this snippet    Add to My Saved Code

Just click on your form and Move it on your screen. Useful utility for the forms without title bar. Comments

No comments have been posted about Just click on your form and Move it on your screen. Useful utility for the forms without title bar.. Why not be the first to post a comment about Just click on your form and Move it on your screen. Useful utility for the forms without title bar..

Post your comment

Subject:
Message:
0/1000 characters