Listbox selection in center of the Listbox

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Listbox selection in center of the Listbox

    Hi, I am working on a small project and have been trying to keep the selected item in a listbox in the center of the listbox as you change the selected item. Is it at all possible to do so?
  • Hello Timmy,

    I'm afraid, but I think this won't be possible with the LISTBOX widget since it has no function to set the scroll position manually.

    Maybe you can achieve something similar with the LISTWHEEL widget. Take a look into the sample attached. I have created a LISTWHEEL widget which is able to scroll up and down vie the arrow keys. The selected item will stay centered. On space bar press you can select an item.

    I hope this helps.

    Regards,
    Sven
    Files
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.