How do I move a borderless form using the mouse? 
Author Message
 How do I move a borderless form using the mouse?

One way can be found at
http://www.*-*-*.com/ ~butlerbob/vb/screen/mandrag.htm



Sun, 03 Jun 2001 03:00:00 GMT  
 How do I move a borderless form using the mouse?
Private Const WM_NCLBUTTONDOWN = &HA1&
Private Const HTCAPTION = 2&
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA"
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam
As Any) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
    If Button = vbLeftButton Then
        Call ReleaseCapture
        Call SendMessage(Me.hwnd, WM_NCLBUTTONDOWN, _
        HTCAPTION, ByVal 0&)
    End If
End Sub



Sun, 03 Jun 2001 03:00:00 GMT  
 How do I move a borderless form using the mouse?


Dim XX&, YY&
'*******************************************************************************
***********
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y
As Single)
If Button = 1 Then XX = X: YY = Y  '# X- u. Y-Coordinates as Offset
End Sub
'-------------------------------
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y
As Single)
If Button = 1 Then Move Left + X - XX, Top + Y - YY
End Sub

Juergen.



Sun, 03 Jun 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to move a borderless form?

2. How can you move a borderless form around in 32-bit VB4 Enterprise

3. Moving a shaped borderless form in real time??

4. HELP with moving borderless forms around screen

5. moving borderless window / form

6. moving borderless window / form

7. moving borderless window / form

8. Borderless Borderless Form

9. move a mouse pointer to a different location without moving the mouse

10. Move a borderless window

11. Move resize drag controls in runtime using mouse...

12. Move a line drawn on a Form with mouse

 

 
Powered by phpBB® Forum Software