HBRUSH CListControlColorDlg: : OnCtlColor (CDC * pDC, CWnd * pWnd, UINT nCtlColor)
{
HBRUSH gets=CDialog: : OnCtlColor (pDC, pWnd, nCtlColor);
//TODO: Change any attributes of the DC here
If (nCtlColor==CTLCOLOR_LISTBOX)
{
Return m_brush;
}
//TODO: the Return of a company's brush if the default is not desired
Return gets;
}
And change the if statement to the if (pWnd - & gt; GetDlgCtrlID ()==IDC_LIST_TEST) also not line, change the if statement to the if (nCtlColor==CTLCOLOR_BTN) of the button control doesn't work, don't know why, which ace to give directions, thank you!
CodePudding user response:
Listctrl SetBkColor tryCodePudding user response:
It is said that a new button without CTLCOLOR_BTN newsCodePudding user response:
Is really can change, but if your character set is a Unicode cannot changeInterface style problem, it is because the Unicode mode is mainly interface style problem, just the default character set mode to control the interface style
Only under the XP style CTLCOLOR_LISTBOX background will change
Unicode mode for change with system interface style