分类:
2008-09-17 11:13:10
()
- ()
-- ()
颜色对话框初始化选择
1 --------------------------------------------------------------------------------
CColorDialog dlg(m_clr, 0, this);
if(IDOK==dlg.DoModal())
{
m_clr=dlg.m_cc.rgbResult;
};
2----------------------------------------------------------------------------------------------------
CColorDialog dlg;
dlg.m_cc.Flags |=CC_RGBINIT;
if(IDOK==dlg.DoModal())
{
m_clr=dlg.m_cc.rgbResult;
};
为什么第二套方案不能初始化颜色的选择呢?
标志应当在构造时设置。而不是之后。
__________________
为祖国荣誉而战
原因似乎不是哦!
// The code below uses CColorDialog::m_cc data member to
// customize the settings of CColorDialog. The CColorDialog will
// be shown as full open and with red as the selected color.
CColorDialog dlg;
dlg.m_cc.Flags |= CC_FULLOPEN | CC_RGBINIT;
dlg.m_cc.rgbResult = RGB(255, 0, 0);
dlg.DoModal();
MSDN上的例子。
全部时间均为北京时间. 现在时间是15:09 . |
Powered by: vBulletin Version 2.2.8
Translated and hacked by:
Copyright © Jelsoft Enterprises Limited 2000, 2001.