0

In Stringray grid, there is the ability to use a transparent background which allows the background of the dialog to be shown through the grid.

In the documentation it states:

But be careful; you should disable scrolling or you have to redraw the grid each time it is scrolled (by overriding DoScroll).

I have a scrollable gird and override the DoScroll and make sure I call Redraw and also tried Invalidate, however the grid is still not completely erasing and redrawing.

I also tried using the old drawing method by setting m_bForceOldDrawing to TRUE.

How can I create a grid that has a transparent background that paint correctly after a scroll without leaving artifacts?

laurent
  • 88,262
  • 77
  • 290
  • 428
JProgrammer
  • 2,750
  • 2
  • 25
  • 36

1 Answers1

0

Yes you have to redraw the grid by overriding DoScroll because it is no longer using ScrollWindow to scroll contents because the background is transparent.

However you now have artifacts of the grid over your background.

This is because the background behind the grid is not getting redrawn.

Do you have clipchildren set for the parent?

Another potential problem is that the background is not being drawn because it doesn't realize it has been exposed.

Try calling the parent with the following.

Parent.Invalidate(); Parent.UpdateWindow();

before calling...

Invalidate();

Lee Louviere
  • 5,162
  • 30
  • 54
  • I don't have clipchildren on my parent. But I do now InvalidateRect on the parent and the artefacts no longer exist. However now the redraw flickers horribly making it unusable still and more suggestions? – JProgrammer Jan 28 '11 at 04:27
  • That's because it's alternating between drawing the parent and the child. Do you have source code of the control? If so, you can edit the control to capture the parent background before drawing the grid, and draw both in a memory DC before bitblt to the device DC for the grid's window. Then it wouldn't flicker. – Lee Louviere Jan 31 '11 at 18:57