Ask Your Question

How to open a form hidden

asked 2021-04-11 23:17:22 +0200

gkick gravatar image


I don't seem to be able to find a reference or a post as to how a form is opened in hidden mode. Some of my forms on open need to hide toolbars and menu, resizing and repositioning, changing the title etc.

All this works ok however there s a fair bit of undesired screen action like the form first opening in the center, then it moves to the desired position, then zoom takes effect and so forth. So I was wondering if it is possible to open the form hidden and only switch to visible after all the form prep has been done.

Thank you

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2021-04-12 00:22:18 +0200

Ratslinger gravatar image

updated 2021-04-12 00:25:32 +0200


Don't know how much success you will have as there are layers of bugs concerning screen redrawing and positioning. This has been a mess for years now.

Have done hiding/minimizing for Calc on this post -> Open Spreadsheet Mimimised - BASIC

Have also done that in conjunction with locking/unlocking Controllers (stopping screen updating). There are varying successes and failures with these and may be different with LO version and OS. Here is some sample code to experiment with (I tested as attached to Open Document event of form):

Sub prep
   oController = ThisComponent.getCurrentController()
   oFrame = oController.getFrame()
   oContainerWindow = oFrame.ContainerWindow
   oContainerWindow.Visible = False
    wait 300
Rem do stuff here if wanted
    Wait 100
    oContainerWindow.Visible = True
End Sub

This was all in the process of testing stuff. Don't even have DIM statements in the Sub.

Don't really think it will all be smooth until the bugs are fixed.

edit flag offensive delete link more


@Ratslinger Thank you kindly, will give it a shot anyway

gkick gravatar imagegkick ( 2021-04-12 00:40:27 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2021-04-11 23:17:22 +0200

Seen: 23 times

Last updated: Apr 12