} // TODO: Return a different brush if the default is not desired return hbr; }
如果要指定某个特定控件可以这样写:ID为IDC_STATIC1
if(pWnd-> GetDlgCtrlID()==IDC_STATIC1) { pDC-> SetTextColor(RGB(255,0,0)); //设置字体颜色 pDC-> SetBkMode(TRANSPARENT); //设置字体背景为透明 // TODO: Return a different brush if the default is not desired return (HBRUSH)::GetStockObject(BLACK_BRUSH); // 设置背景色 } else return hbr;