共用方式為


CMFCColorMenuButton::OpenColorDialog

Opens a color selection dialog box.

virtual BOOL OpenColorDialog(
   const COLORREF colorDefault,
   COLORREF& colorRes 
);

Parameters

  • [in] colorDefault
    The default color that is selected in the color dialog box.

  • [out] colorRes
    Returns the color that the user selects from the color dialog box.

Return Value

Nonzero if the user selects a new color; otherwise, zero.

Remarks

When the menu button is clicked, call this method to open a color dialog box. If the return value is nonzero, the color that the user selects is stored in the colorRes parameter. Use the CMFCColorMenuButton::EnableOtherButton method to switch between the standard color dialog box and the CMFCColorDialog Class dialog box.

Requirements

Header: afxcolormenubutton.h

See Also

Reference

CMFCColorMenuButton Class

Hierarchy Chart

COLORREF