✅ Winforms redraw question

To start: I am still a very early beginner in c# and winforms, so sorry if im asking something obvious.

I am trying to make a personal desktop application for displaying games from a database.

At first I had displayed the data in a datagridview but after getting a bit better at c# I was trying to add panels to a panel that had a picture and some text (see picture1 (ignore the text, I was still testing stuff)). Now I finally got the panels to be added programmatically, but now whenever I scroll through the panel that has autoScroll on the dynamically added panels with the game pictures get redrawn or reloaded (see picture2).

Now what I was wondering is why this happens? I assume it has something to do with the fact that there are so many images (the panels themselves all have background images, the tag labels (the yellow and gray pieces) also are images)

Below is the method I made to draw the panels
https://pastebin.com/rZy6QNtP

If any more info is needed to help, please let me know
image.png
image.png
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Was this page helpful?