Solved

Owner draw CProgressCtrl

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ODBC Connection Logging, ADO.NET 6 64
fizzArray  challenge 1 83
twoTwo  challenge 35 102
Change to event 1 112
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 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