Hide listbox via macro

Hi!
I need to hide a listbox when the other listbox is changed.
Spent 3 days reading manuals and forums, trying to combine different solutions, with no luck.
Made a sample file, please help to correct the code.
Thank you.

test macro.ods (43.6 KB)

Sub InitialForm()
	ThisComponent.CurrentController.ActiveSheet.Drawpage.Forms.getByName("List").Visible = False
End Sub

definitely a valid concern :expressionless:
feel free : Joining the Documentation Team - The Document Foundation Wiki

and for reference :

def hide_other_on_1(event):
    this = event.Source
    form = this.Model.Parent
    other = form['List']
    other.EnableVisible = (this.SelectedItem == '0')

yes its python, probably you need apso.oxt from there

1 Like
lst = ThisComponent.CurrentController.ActiveSheet.Drawpage.Forms.getByName(Standard).getByName(List)
lst.EnableVisible = False

Thank you so much for a detailed answer. It worked, just had to wrap names in quotes:

lst = ThisComponent.CurrentController.ActiveSheet.Drawpage.Forms.getByName("Standard").getByName("List")
lst.EnableVisible = False