JMongi
Active member
- Local time
- Yesterday, 23:25
- Joined
- Jan 6, 2021
- Messages
- 802
Currently I am using @isladogs sample code for hiding the Access application window. Related to this is code that simulates dragging around a window using a form header. There are API calls involved. But, I don't think that particular code is relevant. Here IS the relevant code. This code is in the form header on mouse down.
The code itself works great! But, I have to add this code to each graphical element within the header like labels and images. Is there a clever way to minimize the locations for this code? Currently my main dashboard needs 4 such code blocks. Also, each form I create will likely need a similar 4 block section. Just reaching out to see if there are clever VBA options I'm unfamiliar with. Thanks to all the gurus who read this and comment!
Code:
Private Sub FormHeader_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error GoTo ErrHandler
X = ReleaseCapture()
X = SendMessage(Me.hWnd, WM_NCLBUTTONDOWN, HT_CAPTION, 0)
Exit Sub
ExitHandler:
'Insert Any Code That Needs To Come After Error Handler Here
Exit Sub
ErrHandler:
Call ErrProcessor
Resume ExitHandler
End Sub
The code itself works great! But, I have to add this code to each graphical element within the header like labels and images. Is there a clever way to minimize the locations for this code? Currently my main dashboard needs 4 such code blocks. Also, each form I create will likely need a similar 4 block section. Just reaching out to see if there are clever VBA options I'm unfamiliar with. Thanks to all the gurus who read this and comment!