# How to open a form hidden edit

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

edit retag close merge delete

Sort by » oldest newest most voted

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.

more
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.24301362037658691, "perplexity": 2556.959032544604}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-21/segments/1620243991378.48/warc/CC-MAIN-20210515070344-20210515100344-00404.warc.gz"}