Click here to Skip to main content
13,299,727 members (55,653 online)
Click here to Skip to main content
Add your own
alternative version


8 bookmarked
Posted 7 Aug 2001

Choose Color Dialog

, 7 Aug 2001
Rate this:
Please Sign up or sign in to vote.
This article demonstrates a tool for previewing foreground and background color combinations.
<!-- Download Links --> <!-- Article image -->

Sample Image - cclrdlg.gif

<!-- Main HTML starts here -->


I often wonder what color combinations will look like when selecting colors to use for a control. I also find myself wondering what the red, green, and blue values for an RGB value are. The Choose Color utility is meant to be used to preview foreground and background color selections as well as decode an RGB value into its red, green, and blue components. 

To preview a color just enter the red green values. To decode an RGB value into its red, green, and blue components just enter an RGB value and leave the RGB edit control. When it looses the focus the red, green, and blue values will be displayed for the entered RGB value. 

The utility shows the common MFC example for handling the dynamic setting of the foreground and background colors for a control. If you view the ColorStatic.cpp file you will see the implementation of the CColorStatic class. It has member functions for setting the foreground and background color of the static control. The main workhorse of the class is the CtlColor function.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Software Developer
United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionHow to change the Color Palatte of Gif File. Pin
pubba6-Jul-04 18:54
susspubba6-Jul-04 18:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.171207.1 | Last Updated 8 Aug 2001
Article Copyright 2001 by PPresedo
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid