vs2012 mfc修改静态文本控件字体颜色 怎么修改?

在网上看了好多的,都是添加onCtlcolor函数就可以了 为什么我试了就是不成功呢!?郁闷 Ing

http://blog.csdn.net/liufei_learning/article/details/6105412
控件名字等是否对应正确

重新编译 生成的 不应该有问题的 .....

正确啊 看过了

HBRUSH CPenWidthsDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
// Call the base class implementation first! Otherwise, it may
// undo what we're trying to accomplish here.
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);

// Are we painting the IDC_MYSTATIC control? We can use
// CWnd::GetDlgCtrlID() to perform the most efficient test.
if (pWnd->GetDlgCtrlID() == IDC_MYSTATIC) // 控件ID名
{
// Set the text color to red
pDC->SetTextColor(RGB(255, 0, 0));

  // Set the background mode for text to transparent 
  // so background will show thru.
  pDC->SetBkMode(TRANSPARENT);

  // Return handle to our CBrush object
  hbr = m_brush;

}

return hbr;
}

OnCtlColor中去修改