?
Solved

Flickering Button on CToolBar

Posted on 2006-10-30
4
Medium Priority
?
387 Views
Last Modified: 2013-11-20
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
0
Comment
Question by:rickatseasoft
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 22

Assisted Solution

by:mahesh1402
mahesh1402 earned 750 total points
ID: 17839960
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
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 750 total points
ID: 17840244
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
 

Author Comment

by:rickatseasoft
ID: 17843681
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
 

Author Comment

by:rickatseasoft
ID: 17888342
I'll just clean this up and award points for effort.
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month13 days, 5 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question