Flicker free custom drawn control on dialog possible? 
Author Message
 Flicker free custom drawn control on dialog possible?

Hello

I'm trying to get a flicker free custom drawn control (derived from
CStatic) to work. I want to use this control on a dialog (CDialog).

I've read some things about MemDC and tried to use it with my control:
the flickering only reduced, but didn't disappear completely
(moreover, now my whole dialog background get's erased and I cannot
see the other controls I've got there too...).

I'm returning FALSE in my custom control OnEraseBkgrnd() function and
using the MemDC class to paint to the double buffer - but even if I
make my control very small, the flickering is annoying.

any suggestions?

thanks in advance
Nicolas



Fri, 25 Nov 2005 06:57:37 GMT  
 Flicker free custom drawn control on dialog possible?
If the control is being used as a background, there are two considerations. First, you
have to make sure it has the WS_CLIPSIBLINGS style set. Then you have to make sure it is
last on the Z-order. Due to gross negligence, for over a decade the dialog editor has got
the Z-order wrong: if a control is in front at design time, it is in back at run time, and
vice-versa. This has been a colossal pain (one of the few ways VS7 actually is an
improvement over VS6 is that it finally dawned on someone to actually fix this bug!)

What I usually do is change the Z-order of such a control at runtime, because otherwise it
is too hard to deal with at design time. Use SetWindowPos to do this in OnInitDialog.
                                        joe

Quote:

>Hello

>I'm trying to get a flicker free custom drawn control (derived from
>CStatic) to work. I want to use this control on a dialog (CDialog).

>I've read some things about MemDC and tried to use it with my control:
>the flickering only reduced, but didn't disappear completely
>(moreover, now my whole dialog background get's erased and I cannot
>see the other controls I've got there too...).

>I'm returning FALSE in my custom control OnEraseBkgrnd() function and
>using the MemDC class to paint to the double buffer - but even if I
>make my control very small, the flickering is annoying.

>any suggestions?

>thanks in advance
>Nicolas

Joseph M. Newcomer [MVP]

Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm


Fri, 25 Nov 2005 07:43:31 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Transparent control and flicker-free drawing...

2. Flicker-free drawing of HTML Control

3. Easy way to have flicker free drawing in a List Control

4. Flicker-free custom ListCtrl ?

5. Flicker-free drawing with CCtrlView-derived class, CMemDC, and CDC::GetClipBox()

6. Flicker-free drawing

7. flicker free drawing

8. Flicker free drawing on status bar?

9. flicker and flash free drawing

10. Flicker-Free Drawing??

11. Flicker-free drawing with CCtrlView-derived class, CMemDC, and CDC::GetClipBox()

12. draw new content flicker free

 

 
Powered by phpBB® Forum Software