LO base open form full screen when launching database, how?

With both events the same: Doesn’t maximize in Windows?

Last solution, if setting size doesn’t work, is setting Fullscreen …

FUNCTION Fullscreen(boSwitch AS BOOLEAN)
 DIM oDispatcher AS OBJECT
 DIM Props(0) AS NEW com.sun.star.beans.PropertyValue
 oDispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
 Props(0).Name = "FullScreen"
 Props(0).Value = boSwitch
 oDispatcher.executeDispatch(ThisComponent.CurrentController.Frame, ".uno:FullScreen", "", 0, Props())
END FUNCTION

@JohnB47 :Try to execute the macro when form has already be opened. So we could see if the event is the reason. Try also with other values for width and height. Doesen’t it change the bahvior?

1 Like

Let’s try it together.
Addresses_3.odb (14.4 KB)

I have the window maximized in my example.

1 Like

Good to read. I have created many databases with this kind of forms, also for Windows-user. Never got a feedback it isn’t working, but might be they didn’t recognize it should be maximized. :grinning:

2 Likes

Well, Addresses_3.odb actually works for me. I must carefully check that code in Addresses.odb

Can’t understand why it wasn’t working early. I’ll get back to you.

OK, I have deleted all previous versions of Addresses.odb and downloaded it again from the post above. I also have Addresses_3.odb I have made no changes to either.

The form in Addresses.odb does not open maximised but the form on Addresses_3.odb does

Any idea what’s happening here?

The “View created” event (event name OnViewCreated), which is listened to in the document Addresses.odb, occurs before the “Open Document” event (event name OnLoad), which is listened to in the document Addresses_3.odb.
Probably for a Windows system this lag between events is significant. When Msgbox is issued the window is at its maximum in both cases. In the case of the OnViewCreated event listener, the window loses (after closing the Msgbox window) its maximum size.

1 Like

By the way, the sequence of events when opening a text document (not counting focus-related events):
OnLoadFinished, OnTitleChanged, OnViewCreated, OnLoad, OnPageCountChange, OnLayoutFinished (OnLayoutFinished), OnPageCountChange.

For large documents there may be several OnPageCountChange events.

1 Like

Thanks. Seems to be getting clearer to me. I’ll try setting my db to the option that works on my PC. I’ll report back, probably tomorrow now.