Solved

Owner draw CProgressCtrl

Posted on 1997-01-06
1
1,030 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 50 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

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Suggested Courses

623 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