Flickering Button on CToolBar

I have a CToolBar that contains several owner draw buttons with Icons, 2 CComboBoxes, and one standard CButton.

On startup one CComboBox is empty, while the other is populated.  So long as the one CComboBox is empty, then one of the owner drawn CButtons flickers on mouse movement.  To stop the flicker, all I need to do is AddString("         ");

The problem is solved (by a work-around), unless there are latent problems, but it really has piqued my curiosity.

Any ideas??

Thanks in advance, Rick
rickatseasoftAsked:
Who is Participating?
 
AndyAinscowConnect With a Mentor Freelance programmer / ConsultantCommented:
I guess it is constantly being redrawn when the mouse moves.  Do you have some code doing an Invalidate() in response to a mouse event?
0
 
mahesh1402Connect With a Mentor Commented:
I am not sure what kind of flickering problem you are facing.. is it your custom toolbar derived from CToolBar ?

to decrease toolbar you may try override OnEraseBackGround and return TRUE from function;

/* CMyToolBar inherit from standard CToolbar */

CMyToolBar::OnEraseBackground()
{
  return TRUE;
}


-MAHESH
0
 
rickatseasoftAuthor Commented:
No redrawing or anything.

Remember that this is fixed entirely when a string is added to a CComboBox that is really a clistbox.

Rick
0
 
rickatseasoftAuthor Commented:
I'll just clean this up and award points for effort.
0
All Courses

From novice to tech pro — start learning today.