请问:如何改变菜单栏的背景色
不是下拉菜单,而是整个菜单栏的背景色,如果有源码的话,能给我发一份吗,十分感谢
邮箱:doritosshenhui@yahoo.com.cn
[解决办法]
重载OnCtlColor函数
HBRUSH CXXXDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
HBRUSH m_brush = CreateSolidBrush(RGB(0,0,85));
// TODO: Change any attributes of the DC here
int nID = pWnd-> GetDlgCtrlID();
//pDC-> SetBkMode(OPAQUE);
if( nID == IDC_MENU) //对指定的控件设属性
{
pDC-> SetTextColor(RGB(255,255,255));
pDC-> SetBkMode(TRANSPARENT);
return m_brush;
}
// TODO: Return a different brush if the default is not desired
return hbr;
}
[解决办法]
http://www.vckbase.com/document/viewdoc/?id=317
这个例子实现了对菜单栏背景色的修改
不过例子的目的不是这个
加上菜单后也存在一些问题
不过你可以借鉴一下