在mfc中创建自定义对话框
我需要在mfc中创建一个自定义对话框,该对话框的外观与通常的mfc对话框不同。例如,颜色应为蓝色,样式等。是否可能?我该怎么做 我用谷歌搜索了背景色:在mfc中创建自定义对话框,mfc,customdialog,Mfc,Customdialog,我需要在mfc中创建一个自定义对话框,该对话框的外观与通常的mfc对话框不同。例如,颜色应为蓝色,样式等。是否可能?我该怎么做 我用谷歌搜索了背景色: 看见 //CMyDlg.h //Add a CBrush object class CMyDlg : public CDialog { // Construction public: CTest2Dlg(CWnd* pParent = NULL); // standard constructor CBrush
看见
//CMyDlg.h
//Add a CBrush object
class CMyDlg : public CDialog
{
// Construction
public:
CTest2Dlg(CWnd* pParent = NULL); // standard constructor
CBrush m_brush;
// Dialog Data
//initialize the brush with the desired color in the OnInitDialog() methodl
BOOL CMyDlg::OnInitDialog()
{
m_brush.CreateSolidBrush(RGB(255,0,0));
CDialog::OnInitDialog();
}
//Return the brush like this:
HBRUSH CMyDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
// HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Return a different brush if the default is not desired
return m_brush;
}'