1

I have a FlowLayoutPanel on my Windows Form, it has a max of 100 panels with text, buttons and pictures. When the number of panels is great enough to allow scrolling, the scroll up/down render like this screenshot :S

weird FlowLayoutPanel render when scrolling

I have tried with DoubleBuffering but the result is the same.

Windgate
  • 365
  • 1
  • 4
  • 14
  • No one(maybe someone) will be able to help you. Please provide more info. Maybe your winforms layout. – panoskarajohn Nov 19 '19 at 14:47
  • 1
    You should post the code that generates the Panels and their content. Is this Panel a UserControl? Are you performing some sort of calculations, on the `Resize` event of a container? Are you using anchors/docking when adding the Panel to its container? Are you performing some kind of painting somewhere? Are these standard controls of some 3rd party controls? If you create a clean Solution, one Form with one FLP and add ~100 Panels with some controls (including a Bitmap, no other logic applied) to the FLP, does the problem reproduce? Did you try to set Double Buffering on which control? – Jimi Nov 19 '19 at 15:01
  • Does your FLP have a BackGroundImage? Are you attaching event handlers to the child controls? Do you just add components or you also remove them? If so, how do you remove them? – Jimi Nov 19 '19 at 15:09
  • [Double Buffer](https://learn.microsoft.com/en-us/dotnet/framework/winforms/advanced/how-to-reduce-graphics-flicker-with-double-buffering-for-forms-and-controls) your controls to reduce the flicker for now. –  Nov 19 '19 at 17:50
  • 1
    There is no good answer for that many controls you may want to rethink your solution. The following will fix the refresh issue but there are consequences. https://stackoverflow.com/questions/25872849/to-reduce-flicker-by-double-buffer-setstyle-vs-overriding-createparam – EJD Nov 19 '19 at 18:04
  • @EJD lol that solution works fine, thanks! – Windgate Nov 20 '19 at 12:21
  • So the consequences are flickering and issues with minimize and maximize and since your are going to be double refreshing 100 controls that will take up resources from the GPU and CPU and maybe memory. I would look into maybe enabling double refreshing when scrolling then turn it off after the scrolling stopped. – EJD Nov 20 '19 at 16:21

0 Answers0