1

I have a custom control that inherits from Panel. I end up putting several DataGrids and Labels on this panel. When it gets too long it auto scrolls for me.

I really need the scrolling because it is a list of scanned in objects that will grow larger than the space on the screen will allow.

But when I scroll it flickers quite a lot. I would love to have it give me some smooth scrolling.

I have seen several "Compact Framework" double buffer examples out there, but they all are double buffering draw methods (ie graphics.DrawString). My custom control does not do any painting by itself. It just puts normal grids and labels on the panel and lets the panel paint them.

Is there a way to double buffer normal controls (again NOT custom painting)?

Vaccano
  • 78,325
  • 149
  • 468
  • 850

1 Answers1

1

The Compact Framework Controls do not have the DoubleBuffered property or the underlying double-buffering mechanism. There's no way to add it either.

The only way to get double-buffering is to override the painting of the control and do your own.

ctacke
  • 66,480
  • 18
  • 94
  • 155
  • Thanks for the pointer. I tried to BitBlt the panel and the controls on the panel in their OnPaint methods, but it did not improve the distorting of the scrolling (it doesn't so much flicker. It really is painting partials of the controls and paints too slow and chunky). I have not had to do much with BitBlt since my C++ days (years and years ago). So I may have done it wrong. If you have any sample code that could help with the double buffering that would be great. – Vaccano Feb 18 '11 at 21:16