Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Owner draw CProgressCtrl

Posted on 1997-01-06
1
Medium Priority
?
1,054 Views
Last Modified: 2013-11-20
How do you create an owner draw CProgressCtrl (or change the regular CProgressCtrl) control that will display it's bar in different colors according to the input valuse it receives ? (i.e. the first part of it will be green, then yellow, and finally red)
0
Comment
Question by:ultguide
[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
1 Comment
 

Accepted Solution

by:
doronh earned 100 total points
ID: 1300416
The easiest way to do this is to derive a class from CProgressCtrl and override the OnPaint function (use ClassWizard to this).  In the CDialog derived class, add a member of the derived CProgressCtrl.  In OnInitDialog (use class Wizard to add it (WM_INITDIALOG is the message)), call
CProgressCtrl::SubclassDlgItem(...).  It might be easier to show the progress as a full bar rather than the mini rectangles that the standard control uses.

The color of the progress bar is determined by the selection color that is set in the user settings.

doron
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

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 …
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

722 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