How to open a form hidden

Hi,

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

Hello,

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
    ThisComponent.lockControllers()
    wait 300
Rem do stuff here if wanted
    ThisComponent.unlockControllers()
    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.

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