Can the windows title bar be changed?

I"m not sure if I’m using the correct terminology, so I’ve added an Image below to point it out (Yellow and Blue Arrow)

Is there a way to change/remove the Exit,Max,Min buttons, along with the Title, in the windows title bar?

Thanks.

For removing the Min, Max buttons use a macro which at the start of the odb, minimizes the Libreoffice window to the taskbar while opening a “Main Menu” form. The close X will remain however. A solution for the title bar will follow soon after this post!

  • Edit Macros and create the sub routine in a module of the odb (Standard / Module1).
  • Without opening any forms, attach to the Open Document event of the opened odb file: LO Main window menu - Tools - Customize - Events. Save the odb, close, and reopen. “Enable Macros”
  • To revert the changes, “Disable Macros” upon opening the odb, remove the macro from the odb file Open Document event. The macre does not need to be deleted unless desired. Save and reopen! Here is the sub:

Sub winLOMin()
Dim objA, objB, objC
objA=thisDatabaseDocument.formDocuments()
If objA.hasByName(“Main Menu”) then
objB=objA.getByName(“Main Menu”)
Else
Exit sub
Endif
objC=thisDatabaseDocument.currentController()
objC.connect()
doEvents
objB.open()
doEvents
objC.frame.containerWindow.isMinimized()=true
End Sub

Thank you for getting back to me.

I think that I’m missing something (probably something asinine) . I’ve added some message boxes (as you will see), and when this is run, I’m getting the “Exit Sub” message. In design mode or not, same message. Thoughts?

Sub winLOMin()
DIM objA, objB, objC
objA=thisDatabaseDocument.formDocuments()
If objA.hasByName(“MainForm”) then
objB=objA.getByName(“MainForm”)
Else
msgbox(“Exit Sub”)
Exit sub
Endif
objC=thisDatabaseDocument.currentController.connect()
objB.open()
doEvents
objC.frame.containerWindow.isMinimized()=true
msgbox(“Finished”)
End Sub

The msgbox is a good debug tool! Looks like you have the wrong Form name! What is the name of the database Form that you want to open along with the odb? Mine is “Main Menu”. Yours may be something else. “MainForm” is usually the name of the first control within a database form, followed by “SubForm” and so on… These are typically not names given to database forms. The database form name is the name you gave the Form when it was created and is now in the database Forms list (LO Base main window - Forms). For example, my “Main Menu” database form has its first control named “MainForm” and a second subform control named “SubForm”. These have nothing to do with the database form name as they are merely control or controller names. My form name is “Main Menu”. I also have other database forms named “Businesses”, “Contacts”, etc…)

Yes, having them both called form is very confusing. My DB Form title is Frm_MainForm so THAT was an easy fix. However…

Replace the code in proximity to the errant highlighted code with these lines:

  • objC=thisDatabaseDocument.currentController()
  • objC.connect()
  • doEvents
  • objB.open()
  • doEvents
  • objD=objC.frame.containerWindow()
  • objD.isMinimized()=true
    You will also need to add objD to the object declarations (DIM…) I apologize for the missteps.

I received the msg “Finished”, LO is minimized, but the min/max buttons are still present.

(Don’t worry about missteps, I have them all the time lol)

Yes, there is a part two… working on it. Mainly about hiding the menus on the form.

Try appending these lines after objD.isMinimized()=true:

  • doEvents
  • objE=thisComponent.currentController()
  • objE.frame.layoutManager.visible()=false
    Again add objE to object declaration line!
  • If this doesn’t work you will have to create another sub routine that includes these two lines and then attach it to Frm_MainForm’s Tools - Customize - Events - Open Document event. Give the sub a name like hideFormMenu() and you can figure out the rest.

Nothing changed after adding those lines and adding objE. :expressionless:
The min/max buttons still work as well.
(Code is so much fun haha)

Updated previous post!

Gotcha. I’m on it.