Gradient Progress control | CodeGuru

Gradient Progress control

  Download Source Code and Example Development Environment: VC5, 95 This is a simple class to display a gradient fill progress control.  It works just like the normal progress control. The main enhancements are that you can customize the colors and toggle the percentage caption’s visibility.  The control can be incorporated into a project like […]

Written By
CodeGuru Staff
CodeGuru Staff
Jan 24, 1999
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

Gradient Progress Control (7961 bytes)  Download Source Code
and Example

Development Environment: VC5, 95

This is a simple class to display a gradient fill progress control.  It works just
like the normal progress control. The main enhancements are that you can customize the
colors and toggle the percentage caption’s visibility. 

The control can be incorporated into a project like any other CProgressCtrl derived
control. Either create the control manually, subclass an existing CProgressCtrl, or use
ClassWizard to DDX_control it.  The actual code for the progress control is located
in GradientProgressCtrl.h and GradientProgressCtrl.cpp. I haven’t fully tested it’s
robustness, although I don’t suspect that it will fail miserably.  Most of the work
happens in the DrawGradient(…) function, which also uses Keith Rule’s MemDC class. 
The sample project also uses Chris Maunder’s ColourPicker.  Both of these classes are
included in the sample project and can be downloaded elsewhere at this site.

It is derived from CProgressCtrl so all standard CProgressCtrl functions are
available.  Additional functions are listed below.

I hope someone gives it a good home :).  Please let me know of any problems or
improvements.  Thanks and good luck.

Member Set Functions

	void SetTextColor(COLORREF color)           // Set the percentage text color
	void SetBkColor(COLORREF color)             // Set background color
	void SetStartColor(COLORREF color)          // Set starting color
	void SetEndColor(COLORREF color)            // Set ending color
	void ShowPercent(BOOL bShowPercent = TRUE)  // Show the percent caption?

Member Get Functions

	COLORREF GetTextColor(void)
	COLORREF GetBkColor(void)
	COLORREF GetStartColor(void)
	COLORREF GetEndColor(void)

 

Last updated: 18 May 1998

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.