[Solved] List box drop down

Creating and using forms
Post Reply
Jjs2060
Posts: 60
Joined: Sat Nov 08, 2014 2:53 am

[Solved] List box drop down

Post by Jjs2060 »

I have a form with several controls, one being a list box. I tab from control to control. What I want to do is...when the list box gets the focus, the drop down list will drop down without having to use the mouse to hit the drop down arrow. Macro code is ok if no other way. Thanks for the help.
Last edited by Jjs2060 on Sun Jan 25, 2015 8:39 pm, edited 1 time in total.
Libre Office 4.2.2.1 on OS X 10.9.3
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: List box drop down

Post by Villeroy »

Sort the list box entries in ascending order.
Use the keyboard to type the first letters of the item you are after.
Additionally you may implement the list box as a multi-line list box rather than drop-down so you can see the neighbouring items of the current item.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
F3K Total
Volunteer
Posts: 1038
Joined: Fri Dec 16, 2011 8:20 pm

Re: List box drop down

Post by F3K Total »

Hi,
i found a method:

Code: Select all

sub Drop_down_Listbox
    oController = thiscomponent.CurrentController
    oListbox = thisComponent.drawpage.forms.getbyname("MainForm").getbyname("myListbox")
    oListboxControl = oController.getControl(oListbox)
    oListboxControl.AccessibleContext.doAccessibleAction(0)'drops it down
end sub
R
  • MMove 1.0.6
  • Extension for easy, exact positioning of shapes, pictures, controls, frames ...
  • my current system
  • Windows 10 AOO, LOLinux Mint AOO, LO
Jjs2060
Posts: 60
Joined: Sat Nov 08, 2014 2:53 am

Re: List box drop down

Post by Jjs2060 »

Thank u so much. SOLVED
Libre Office 4.2.2.1 on OS X 10.9.3
Post Reply