Skip to main content
GMeta.1
Associate III
August 5, 2025
Question

Find index of first visible item in scrolllist

  • August 5, 2025
  • 1 reply
  • 387 views

I am using a scrolllist that contains 6 items, 4 of which are visible. It is a horizontal list and non-circular. I'd like to have a couple of indicator items, one to the left and another to the right of the scrolllist to show whether there are items that are not currently visible. Maybe I'll even make these clickable and then auto-scroll left or right. I don't currently see a way to know what items are in view at the moment and @shark has already asked this here:

https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/how-to-get-index-of-first-visible-item-in-a-scrolllist/td-p/213644 

scrollList2UpdateItem() doesn't do anything useful here because it just tells you that you need to update something that is shortly going to be visible.

 

1 reply

ST Employee
August 21, 2025

Hello @GMeta.1,

You can use UpdateItem(), it gives you which element will appear. With this information you know which element are visible are not.
So depending on which value is calling UpdateItem you will either show or hide indicators.
You can check the scroll list/ scroll wheel example to see how this function is called.

BR,
Louis B.