CColorDialog::CColorDialog

Constructs a CColorDialog object.

CColorDialog( 
   COLORREF clrInit = 0, 
   DWORD dwFlags = 0, 
   CWnd* pParentWnd = NULL  
);

Parameters

  • clrInit
    The default color selection. If no value is specified, the default is RGB(0,0,0) (black).

  • dwFlags
    A set of flags that customize the function and appearance of the dialog box. For more information, see the CHOOSECOLOR structure in the Windows SDK.

  • pParentWnd
    A pointer to the dialog box's parent or owner window.

Example

// Show the Color dialog with all the default settings.
CColorDialog dlg1;
dlg1.DoModal();

// Show the fully opened Color dialog with red as the selected color.
CColorDialog dlg2(RGB(255, 0, 0), CC_FULLOPEN);
dlg2.DoModal();

Requirements

Header: afxdlgs.h

See Also

Reference

CColorDialog Class

Hierarchy Chart

CDialog::DoModal