I have added code to one of my databases to drag a form from anywhere within
it.
(Access 2003).
I declared public variables for the form:
Public Xo as Single, Yo as Single.
On the Detail part of the form I added two event procedures:
On Mouse Down, On Mouse Move.
Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
If Button = 1 Then 'Ignore unless left button pressed.
Xo = X 'Get initial coordinates with respect to the top left corner of the
form
Yo = Y
End If
End Sub
Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
If Button = 1 Then 'Ignore unless left button pressed.
Move (Me.WindowLeft + X - Xo), (Me.WindowTop + Y - Yo)
'Move window while keeping cursor in same position relative to window.
End If
End Sub
Regards,
Dave W
----- Original Message -----
From: Kambiz Afshartous kenaf42@yahoo.com [MS_Access_Professionals]
To: MS_Access_Professionals@yahoogroups.com
Sent: Wednesday, July 19, 2017 4:56 PM
Subject: Re: [MS_AccessPros] Re: Dragging borderless form
Thank you Andrew, please do find it.
Kambiz
From: "yahoo@craven.de [MS_Access_Professionals]"
<MS_Access_Professionals@yahoogroups.com>
To: MS_Access_Professionals@yahoogroups.com
Sent: Tuesday, July 18, 2017 3:38 PM
Subject: [MS_AccessPros] Re: Dragging borderless form
With a bit of programming, yes, you can make a borderless form move around
per mouse drag-and-drop. I'm fairly sure I found the code somewhere. I'll
try to find it again.
Yours,
Andrew
Posted by: "Dave Williams" <davewillgmale@gmail.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (12) |
Tidak ada komentar:
Posting Komentar