ListBox does not scrolled smoothly

Hi, thanks for your time.

I have a listbox component within my window (document window), which is relevant to a Listbox Model (I am going to call it ThumbnailListBoxModel, because I want to draw an image and some text within each item of the listbox).

I have successfully override the paintListBoxItem(int rowNumber, Graphics& g,int width, int height,bool rowIsSelected) function and it works fine. However, when the amount of the ListBox item goes up (for example, 1000 items), the ListBox component will not be scrolled smoothly. That means there will be around 1000 images within the Listbox.

What should I do to solve this problem?

You should do the first thing that everyone should do whenever they hit any kind of performance problem: Run a profiler on your code to see where the bottleneck is!

1 Like

Thanks for the suggestion. I just use a self-maintained image cache to solve that. :slight_smile: