Listbox Focus - Forum

Forum Navigation
You need to log in to create posts and topics.

Listbox Focus

Is there a way on page load for a listbox to be the focused object with its first item selected?

I set the tab order so the listbox is first and tried FocusObject, but neither do the trick.

 

@vwatson

Is there a way on page load for a listbox to be the focused object with its first item selected?
I set the tab order so the listbox is first and tried FocusObject, but neither do the trick.

Hopefully, the tab order set the ListBox in focus.

If the ListBox object is called ListBox34 and the 'Variable; (to store selected item)' is [ListBox34] ...

SetVar "[ListBox34]" "yourFirstItemHere"

... if this list is not static (i.e. set/changed dynamically at run time) ...

ListBoxGetItem "ListBox34" "1" "[ListBox34]"

vwatson has reacted to this post.
vwatson

Worked perfectly! Thank you. :)

Also, in Page Properties>Actions:

FocusObject "ListBox34"
ListBoxGetItem "ListBox34" "1" "[ListBox34]"

should work on page load no matter the tab order.