riktek
Member
- Local time
- Today, 15:30
- Joined
- Dec 15, 2023
- Messages
- 77
The thread title. Is there a way to maximize a form, meaning a PopUp form in my case but perhaps also a form if in overlapping forms mode, vertically? Put otherwise, is there a way to get or set this window state for such a form?
By "vertically," I mean vertically-only, retaining the form's width.
One can do this by pressing Win + Shift + Up (and by dragging the top border of a window to the top of the screen), which I've found to be especially handy.
I'm just starting to think about doing this programmatically but the usual suspects don't seem to be up to the task. DoCmd.Maximize is perhaps vestigial in that it predates doing things like this, and it (and the DoCmd object generally) don't provide for more modern window states. I'm not certain there even is a window state property that exists for this. The PjWindowState constants include only maximized, minimized, and normal, and besides apply (via Application.WindowState, and then only for Excel, not Access) only to the application window, as opposed to the form or its window.
Barring a SysCmd of which I am not aware, approaches that come to mind include:
• SendKeys, with all its warts.
• Setting Form.WindowTop and Form.Height, likely with a Win32 call to get screen dimensions. Methinks an un-do with this approach would be circuitous, however.
• An as-yet unknown (to me, that is) window state setting in Win32 that I can get or set via Form.hWnd.
Or perhaps this is done otherwise and I'm unaware of it.
Any thoughts or recommendations, even about the best approach, would be most welcome.
By "vertically," I mean vertically-only, retaining the form's width.
One can do this by pressing Win + Shift + Up (and by dragging the top border of a window to the top of the screen), which I've found to be especially handy.
I'm just starting to think about doing this programmatically but the usual suspects don't seem to be up to the task. DoCmd.Maximize is perhaps vestigial in that it predates doing things like this, and it (and the DoCmd object generally) don't provide for more modern window states. I'm not certain there even is a window state property that exists for this. The PjWindowState constants include only maximized, minimized, and normal, and besides apply (via Application.WindowState, and then only for Excel, not Access) only to the application window, as opposed to the form or its window.
Barring a SysCmd of which I am not aware, approaches that come to mind include:
• SendKeys, with all its warts.
• Setting Form.WindowTop and Form.Height, likely with a Win32 call to get screen dimensions. Methinks an un-do with this approach would be circuitous, however.
• An as-yet unknown (to me, that is) window state setting in Win32 that I can get or set via Form.hWnd.
Or perhaps this is done otherwise and I'm unaware of it.
Any thoughts or recommendations, even about the best approach, would be most welcome.
Last edited: