I currently have a form with a scrollable panel that potentially contains over 100 child controls (only about 10 are viewable on screen at any time)
This causes a lot of flickering when scrolling.
I have been looking at some double-buffering techniques, but they won't work in my case since I am using several child controls (Buttons, Labels, Checkboxes) and they all get painted independently. I can't do anything in the panel's OnPaint method that affect the children.
And several answers I have read state that adding existing controls take more resources rather than, say, instead of a Label, just painting a colored square with text over top.
I have 2 main questions:
- If I were to no longer us child controls, and instead just draw everything in OnPaint of the panel, how can I paint only what is currently visible (considering that the user can scroll)
- How would I implement things like check boxes?