Discussion:
Ribbon used with CListView or CTreeView causes a screen redraw or flicker or flash every time the ribbon tab is clicked on
(too old to reply)
Bob K
2009-01-02 17:17:57 UTC
Permalink
I've converted my MDI application to display tabbed child windows and added
a ribbon. Everything is basically okay except that I now notice that
EVERYTIME I click on a ribbon tab, it redraws all of the child panes. The
whole window blinks off and on. I can't see any reason why that should
affect the child windows.

In using spy, I see a WM_ERASEBKGND being sent to all the child windows!

I took one of the sample programs "office2007" and replaced CView with
CListView and populated it with some dummy entries and I am seeing the same
issue. The list is being redrawn every time the tab on the ribbon is clicked
(oh, I also need to add a second tab since that project creates a ribbon
with a single tab).

I notice if I create child windows using the new feature pack classes, such
as CDockablePane, then THAT window does not flash.

Any ideas?

Thanks,
Bob
Alex Blekhman
2009-01-02 17:59:41 UTC
Permalink
Post by Bob K
I notice if I create child windows using the new feature pack
classes, such as CDockablePane, then THAT window does not flash.
Any ideas?
Probably new classes handle WM_ERASEBKGND message and return TRUE,
so no background repaint occurs.

Alex
Bob K
2009-01-02 21:42:20 UTC
Permalink
Well, I did try overriding WM_ERASEBKGND in CMainFrm and then ignoring it,
but that didn't work as the list views and tree views looked like crap. They
really do need the erase at SOME point.

The problem is I'd like to filter it out only when the user clicks on a
ribbon tab.
Post by Bob K
I notice if I create child windows using the new feature pack classes,
such as CDockablePane, then THAT window does not flash.
Any ideas?
Probably new classes handle WM_ERASEBKGND message and return TRUE, so no
background repaint occurs.
Alex
Alex Blekhman
2009-01-02 22:04:46 UTC
Permalink
Post by Bob K
Well, I did try overriding WM_ERASEBKGND in CMainFrm and then
ignoring it, but that didn't work as the list views and tree
views looked like crap. They really do need the erase at SOME
point.
The problem is I'd like to filter it out only when the user
clicks on a ribbon tab.
Well, I don't have an answer for you, but the least you can do is
to trace message handling routes in new classes. Then make the
same arrangements in your code.

Alex

Loading...