如何设置对话框、控件的背景色、文字颜色

 case WM_CTLCOLORDLG:
  hdc = (HDC)wParam;
  SetTextColor(hdc, RGB(255,0,0));
  SetBkColor(hdc, RGB(255,255,0));
  SetBkMode(hdc, TRANSPARENT);
  return (INT_PTR)BgBrush;
  break;
 case WM_CTLCOLORSTATIC:
  hdc = (HDC)wParam;
  SetTextColor(hdc, RGB(255,0,0));
  SetBkColor(hdc, RGB(255,255,0));
  SetBkMode(hdc, TRANSPARENT);
  return (INT_PTR)CtrlBrush;
  break;
 case WM_CTLCOLORBTN:
  hdc = (HDC)wParam;
  SetTextColor(hdc, RGB(255,0,0));
  SetBkColor(hdc, RGB(255,255,0));
  SetBkMode(hdc, TRANSPARENT);
  return (INT_PTR)CtrlBrush;
  break;
 case WM_CTLCOLOREDIT:
  return (INT_PTR)CtrlBrush;
  break; 

你可能感兴趣的:(如何设置对话框、控件的背景色、文字颜色)