[Solved] Hide Toolbars from form

Creating and using forms

[Solved] Hide Toolbars from form

Postby fenix_27 » Sun Jun 26, 2016 4:50 am

I am trying to make some simple data entry forms.

I am trying to reduce to a minimum the amount of toolbars shown when I open the form. I can manually go into view>toolbars and deselect all of them. However, when I go into edit mode the toolbars are hidden and I need to reshow them.

I am trying to get a macro going on the On Load event, so that toolbars will be hidden.

I downloaded switchboard addon, which has a removeUnwantedToolbars function, however, I can't get it to pass the actual window for the form. The function has a Frame object, but I can't seem to find how to reference the actual form window. I tried the following in the macro.

Sub on_Load(oWindow as object)

removeUnwantedToolbars(oWindow)

But what happens is the toolbars get removed from the main database window.

I can't seem to get this right. Can someone help?
Last edited by fenix_27 on Mon Jun 27, 2016 12:31 am, edited 1 time in total.
LibreOffice 5.1.3.2
Windows 10 64-bit
fenix_27
 
Posts: 1
Joined: Sun Jun 26, 2016 4:38 am

Re: Hide Toolbars from form

Postby UnklDonald418 » Sun Jun 26, 2016 5:12 pm

Using the MRI tool I found that this may do what you need

Code: Select all   Expand viewCollapse view
Sub on_Load(oWindow as object)
Dim oDoc as object

oDoc = oWindow.Source.Parent.Parent
removeUnwantedToolbars(oDoc)
End Sub
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.6 & LibreOffice 6.1.5.2 - Windows 10 Professional
UnklDonald418
Volunteer
 
Posts: 1330
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Hide Toolbars from form

Postby UnklDonald418 » Mon Jun 27, 2016 12:19 am

The argument delivered to on_Load() is actually an Event object not a Window so although this doesn't really change anything this might make the code a little clearer

Code: Select all   Expand viewCollapse view
Sub on_Load(oEvent as object)
Dim oDoc as object

oDoc = oEvent.Source.Parent.Parent
removeUnwantedToolbars(oDoc)
End Sub
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.6 & LibreOffice 6.1.5.2 - Windows 10 Professional
UnklDonald418
Volunteer
 
Posts: 1330
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA


Return to Forms

Who is online

Users browsing this forum: No registered users and 4 guests