# Edit Listbox

**URL:** <https://forum.kirupa.com/t/edit-listbox/7573>\
**Category:** flash\
**Created:** [November 3, 2002, 8:02am UTC](https://forum.kirupa.com/t/edit-listbox/7573 "2002-11-03T08:02:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![waffe](https://avatars.discourse-cdn.com/v4/letter/w/c37758/32.png) [@waffe](https://forum.kirupa.com/u/waffe)\
**Post date:** [November 3, 2002, 8:02am UTC](https://forum.kirupa.com/t/edit-listbox/7573/1 "2002-11-03T08:02:33Z")

</div>

I am looking to edit a listbox a bit.

Here is the scene, I have a listbox that has a lot off items in it but you only see 8 items at a time. I would like if you selected item 8 and the listbox would automatically scroll up 2 levels, exposing items 9 and 10. This would happen every time you selected the first or last item in the listbox.

Hmmm.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 3, 2002, 8:52am UTC](https://forum.kirupa.com/t/edit-listbox/7573/2 "2002-11-03T08:52:59Z")

</div>

Maybe somthing to do y position of the listbox.

if listbox y position = (what ever it is.)  
setSelectedIndex(getSelectedIndex()+1)  
:q:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 4, 2002, 7:19am UTC](https://forum.kirupa.com/t/edit-listbox/7573/3 "2002-11-04T07:19:42Z")

</div>

Better yet, when you use the arrow keys in a listbox it works great. You go to the bottom item and the listbox scrolls up 1 position. How can this be done by selecting the last item with the mouse, and have the listbox go up 1 position.
