VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Move borderless forms with ease by dragging anywhere on the form itself.

by Kelly Ethridge (3 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Tue 19th December 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Move borderless forms with ease by dragging anywhere on the form itself.

API Declarations


Private DX As Single
Private DY As Single


Rate Move borderless forms with ease by dragging anywhere on the form itself.



   If bMoving = False And Button = vbLeftButton Then
      DX = X
      DY = Y
      bMoving = True
   End If
   
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
   If bMoving And ((X <> DX) Or (Y <> DY)) Then
      Move Left + (X - DX), Top + (Y - DY)
   End If
   
End Sub

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
   If Button = vbLeftButton Then
      bMoving = False
   End If
   
End Sub

Download this snippet    Add to My Saved Code

Move borderless forms with ease by dragging anywhere on the form itself. Comments

No comments have been posted about Move borderless forms with ease by dragging anywhere on the form itself.. Why not be the first to post a comment about Move borderless forms with ease by dragging anywhere on the form itself..

Post your comment

Subject:
Message:
0/1000 characters