Click here to Skip to main content
15,898,689 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: change background color of dialog Pin
zhiyuan1629-Dec-08 1:16
zhiyuan1629-Dec-08 1:16 
GeneralRe: change background color of dialog Pin
Malli_S29-Dec-08 1:24
Malli_S29-Dec-08 1:24 
GeneralRe: change background color of dialog Pin
zhiyuan1629-Dec-08 1:43
zhiyuan1629-Dec-08 1:43 
AnswerRe: change background color of dialog Pin
Malli_S29-Dec-08 2:17
Malli_S29-Dec-08 2:17 
GeneralRe: change background color of dialog Pin
zhiyuan1629-Dec-08 17:10
zhiyuan1629-Dec-08 17:10 
GeneralRe: change background color of dialog Pin
Malli_S29-Dec-08 19:09
Malli_S29-Dec-08 19:09 
GeneralRe: change background color of dialog Pin
zhiyuan1629-Dec-08 20:23
zhiyuan1629-Dec-08 20:23 
GeneralRe: change background color of dialog Pin
zhiyuan1629-Dec-08 20:37
zhiyuan1629-Dec-08 20:37 
dear Malli


could you help me to check is it right below: thanks a lot
BOOL CMeiTengDlg::OnDestroyWindow()<br />
{<br />
	//delete it while distroying the dialog.  <br />
	m_objMyBrush.DeleteObject();<br />
	return TRUE;<br />
}<br />
<br />
<br />
HBRUSH CMeiTengDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)<br />
{<br />
	<br />
	return m_objMyBrush;<br />
}<br />
<br />
void CMeiTengDlg::SetBackgroundColor(COLORREF color)<br />
{<br />
	m_objMyBrush.DeleteObject();	<br />
	m_objMyBrush.CreateSolidBrush( color );	<br />
	<br />
   //redraw<br />
   Invalidate(TRUE);<br />
}<br />
<br />
void CMeiTengDlg::OnBnClickedChangebkcolor()<br />
{<br />
	// TODO: Add your control notification handler code here<br />
	CColorDialog dlg;<br />
	if (dlg.DoModal() == IDOK) <br />
		color=dlg.GetColor(); <br />
	//change my background color of dialog code here<br />
	SetBackgroundColor(color);<br />
}<br />

GeneralRe: change background color of dialog Pin
Malli_S29-Dec-08 21:11
Malli_S29-Dec-08 21:11 
GeneralRe: change background color of dialog Pin
zhiyuan1629-Dec-08 21:26
zhiyuan1629-Dec-08 21:26 
GeneralRe: change background color of dialog Pin
Malli_S29-Dec-08 22:07
Malli_S29-Dec-08 22:07 
GeneralRe: change background color of dialog Pin
zhiyuan1629-Dec-08 23:24
zhiyuan1629-Dec-08 23:24 
AnswerRe: change background color of dialog Pin
Malli_S29-Dec-08 23:49
Malli_S29-Dec-08 23:49 
GeneralRe: change background color of dialog Pin
zhiyuan1629-Dec-08 23:58
zhiyuan1629-Dec-08 23:58 
AnswerRe: change background color of dialog Pin
Jijo.Raj29-Dec-08 1:22
Jijo.Raj29-Dec-08 1:22 
Questionhow to proceed?? Pin
debonair12345629-Dec-08 0:52
debonair12345629-Dec-08 0:52 
AnswerRe: how to proceed?? Pin
Malli_S29-Dec-08 1:21
Malli_S29-Dec-08 1:21 
GeneralRe: how to proceed?? Pin
debonair12345629-Dec-08 1:38
debonair12345629-Dec-08 1:38 
GeneralRe: how to proceed?? Pin
Malli_S29-Dec-08 2:30
Malli_S29-Dec-08 2:30 
AnswerRe: how to proceed?? Pin
Hamid_RT29-Dec-08 1:34
Hamid_RT29-Dec-08 1:34 
GeneralRe: how to proceed?? Pin
debonair12345629-Dec-08 1:54
debonair12345629-Dec-08 1:54 
GeneralRe: how to proceed?? Pin
ThatsAlok29-Dec-08 21:57
ThatsAlok29-Dec-08 21:57 
GeneralRe: how to proceed?? Pin
debonair12345629-Dec-08 22:56
debonair12345629-Dec-08 22:56 
GeneralRe: how to proceed?? Pin
ThatsAlok30-Dec-08 0:07
ThatsAlok30-Dec-08 0:07 
GeneralRe: how to proceed?? [modified] Pin
debonair12345630-Dec-08 0:52
debonair12345630-Dec-08 0:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.