Solved

Owner draw CProgressCtrl

Posted on 1997-01-06
1
955 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
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now