The CMFCColorDialog class represents a color selection dialog box.
Constructs a CMFCColorDialog object.
Returns the current selected color.
Returns the color's palette.
Translates window messages before they are dispatched to the TranslateMessage and DispatchMessage Windows functions. For syntax and more information, see CWnd::PreTranslateMessage. (Overrides CDialogEx::PreTranslateMessage.)
Derives a palette from the system palette.
Sets the current selected color.
Sets the color most equivalent to a specified RGB value.
Selects an RGB value for the first property page.
Selects an RGB value for the second property page.
Protected Data Members
TRUE if the color selection dialog box uses its own color palette, or FALSE if the dialog box uses a palette that is specified in the CMFCColorDialog constructor.
TRUE while the user is selecting a color from the selection dialog box; otherwise, FALSE.
The color button that the user has selected.
The currently selected color.
The cursor that is used to pick a color.
The prospective selected color, which can be permanently selected or reverted to the original color.
A pointer to the first property page of the color selection property sheet.
A pointer to the second property page of the color selection property sheet.
The current logical palette.
A pointer to the property sheet for the color selection dialog box.
A color picker control object.
A static control that is a placeholder for the color picker property sheet.
The color selection dialog box is displayed as a property sheet with two pages. On the first page, you select a standard color from the system palette; on the second page, you select a custom color.
You can construct a CMFCColorDialog object on the stack and then call DoModal, passing the initial color as a parameter to the CMFCColorDialog constructor. The color selection dialog box then creates several CMFCColorPickerCtrl Class objects to handle each color palette.
The following example demonstrates how to configure a color dialog by using various methods in the CMFCColorDialog class. The example shows how to set the current and the new colors of the dialog, and how to set the red, green, and blue components of a selected color on the two property pages of the color dialog. This example is part of the New Controls sample.