本文介绍了901223-如何更改对话框的背景色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨要更改对话框的默认背景色,我尝试覆盖它的PreCreateWindow函数:

 BOOL CMyDialog :: PreCreateWindow(CREATESTRUCT& cs)
{
//  TODO:在此处添加您的专用代码和/或调用基类
如果(CDialog :: PreCreateWindow(cs)==否)
返回为假;

CBrush br;
VERIFY(br.CreateSolidBrush(RGB( 251  235  202 ))));
cs.lpszClass = AfxRegisterWndClass( 0 ,:: LoadCursor(NULL,IDC_ARROW),br,NULL);

返回 TRUE;
} 

,但看来DoModal不会导致它被调用.
您的建议是什么?

解决方案



hifor changing the default background color of a dialog, i tried overriding it PreCreateWindow function:

BOOL CMyDialog::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Add your specialized code here and/or call the base class
	if (CDialog::PreCreateWindow(cs) == FALSE)
		return FALSE;

	CBrush br;
	VERIFY(br.CreateSolidBrush(RGB(251, 235, 202)));
	cs.lpszClass = AfxRegisterWndClass(0, ::LoadCursor(NULL, IDC_ARROW), br, NULL);

	return TRUE;
}

but it seems that DoModal doesn''t cause it to be called.
what''s ur suggestion?

解决方案




这篇关于901223-如何更改对话框的背景色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 20:37