One way to fix a form’s size whenever it opens,
is to cause it to Open “Maximized”.
You can do this by using this Macro:
REM ===================================================
REM Maximize the Calling Window
Sub MaxWin
oCurrentController = ThisComponent.getCurrentController()
oFrame = oCurrentController.getFrame()
oContainerWindow = oFrame.getContainerWindow()
oContainerWindow.isMaximized = True
End Sub
REM ===================================================
Once you save this Macro in your Database’s Standard Library,
you need to cause the Form to “call” this Macro on the
“When loading” event on the “Events” tab.
Here is how you do that:
- Open the “.odb” file in LibreOffice Base.
- Click on the Form Name.
- Click on the “Edit” button at the top of the screen.
This will open the Form in “Design Mode”.
- Click on the “Form” button at the bottom of the screen.
(Sometimes the bottom buttons are "off-the-screen.)
This will open the “Form Properties” screen.
- Click on the “Events” tab.
- Click on the “…” button to the far-right of the “When loading” line.
This brings up an “Assign Action” screen.
- Click the “Macro” button in the upper-right.
- Drill-down in the “Library” window until you see “MaxWin” Macro.
- Click on that Macro.
- Click on the next couple of “OK” buttons.
The “When loading” line should have something like this in it:
The Standard.myLibraryname.MaxWin (document, Basic)
- Close the “Form Properties” screen.
- Save the changes to your “.odb” file .
The next time you open that Form, it will automatically be Maximized!
TerryHarris584