Click here to Skip to main content
15,914,820 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want to change the colour of the inner area of check box using MFC.
Please help me.

Thank you
Posted
Updated 23-Mar-11 0:51am
v2

1 solution

This is the code for STATIC control.
maybe can help you.

first you have to add OnCtlColor event to draw the controls.
then use setbkcolor function.
HBRUSH CApplication1Dlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
	HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor);
	switch(nCtlColor){
	case(CTLCOLOR_STATIC):{
		pDC->SetBkColor(RGB(91,148,214));
		break;
	}
	}

	return hbr;
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900