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

C / C++ / MFC

 
AnswerRe: IntelliSense:'No additional information available' in VC++2005. Pin
Jijo.Raj29-Dec-08 3:08
Jijo.Raj29-Dec-08 3:08 
AnswerRe: IntelliSense:'No additional information available' in VC++2005. Pin
Randor 29-Dec-08 8:39
professional Randor 29-Dec-08 8:39 
Questionchange background color of dialog Pin
zhiyuan1629-Dec-08 0:59
zhiyuan1629-Dec-08 0:59 
AnswerRe: change background color of dialog Pin
Malli_S29-Dec-08 1:04
Malli_S29-Dec-08 1:04 
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 
I hope following code snippet will help you. I've not included the details in depth. Just try it out.

class CMeiTengDlg: public CDialog
{
...
//Add the member variable.
protected:
 CBrush m_objMyBrush;

...
};

BOOL CMyDlg::OnInitDialog()
{
 ...
//initialize it with default brush color (back color)
 m_objMyBrush.CreateSolidBrush(RGB(255, 255, 255)); // color white brush
 ...
}

BOOL CMyDlg::DistroyWindow()
{
//delete it while distroying the dialog.
  m_objMyBrush.DeleteObject();
}

HBRUSH CAboutDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
/*
** No need to do this!
**
** HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
*/

/*
** Return your brush.
*/
return m_objMyBrush;
}

void CMeiTengDlg::OnBnClickedChangebkcolor()
{
	// TODO: Add your control notification handler code here
	CColorDialog dlg; 
	if (dlg.DoModal() == IDOK) 
		COLORREF color=dlg.GetColor(); 
	//change my background color of dialog code here
	changbackground(color);
}

//probably this is what you were searching for
void CMeiTengDlg::changbackground(COLORREF color)
{
	//change the brush color
	m_objMyBrush.DeleteObject();
	m_objMyBrush.CreateSolidBrush( color );
	Invalidate(TRUE);
}


[Delegates]      [Virtual Desktop]      [Tray Me !]

-Malli...! Rose | [Rose]

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 
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 

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.