Click here to Skip to main content
15,908,841 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Costom Draw Problem!!! Pin
Antti Keskinen31-May-04 11:46
Antti Keskinen31-May-04 11:46 
GeneralRe: Costom Draw Problem!!! Pin
VirgoCI31-May-04 17:48
VirgoCI31-May-04 17:48 
Generalsmtp question Pin
includeh1031-May-04 8:16
includeh1031-May-04 8:16 
GeneralRe: smtp question Pin
bryce31-May-04 15:10
bryce31-May-04 15:10 
GeneralProblem with SetTextColor Pin
Aviv Halperin31-May-04 7:50
Aviv Halperin31-May-04 7:50 
GeneralRe: Problem with SetTextColor Pin
Brian D31-May-04 8:15
Brian D31-May-04 8:15 
GeneralRe: Problem with SetTextColor Pin
includeh1031-May-04 8:21
includeh1031-May-04 8:21 
GeneralRe: Problem with SetTextColor Pin
f6431-May-04 8:22
f6431-May-04 8:22 
Hi Check the MSDN fot CWnd::OnCtlColor, it even has a example of what you are asking. You just have to verify the message is for the control you want to change, otherwise do nothing.

Extracted form the MSDN
// This OnCtlColor handler will change the color of a static control
// with the ID of IDC_MYSTATIC. The code assumes that the CMyDialog
// class has an initialized and created CBrush member named m_brush.
// The control will be painted with red text and a background
// color of m_brush.

HBRUSH CZilchDlg::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);

   <big>// Are we painting the IDC_MYSTATIC control? We can use
  // CWnd::GetDlgCtrlID() to perform the most efficient test.</big>   
   if (pWnd->GetDlgCtrlID() == IDC_MYSTATIC)
   {
      // 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;
}


Fabian
GeneralRe: Problem with SetTextColor Pin
Aviv Halperin31-May-04 9:16
Aviv Halperin31-May-04 9:16 
Generaldocumentation of jpeg format Pin
includeh1031-May-04 6:54
includeh1031-May-04 6:54 
GeneralRe: documentation of jpeg format Pin
Nirav Doshi31-May-04 9:11
Nirav Doshi31-May-04 9:11 
GeneralRe: documentation of jpeg format Pin
includeh1031-May-04 9:49
includeh1031-May-04 9:49 
GeneralRe: documentation of jpeg format Pin
Nirav Doshi31-May-04 22:23
Nirav Doshi31-May-04 22:23 
GeneralGradients Pin
Archer28231-May-04 6:35
Archer28231-May-04 6:35 
GeneralRe: Gradients Pin
f6431-May-04 8:00
f6431-May-04 8:00 
GeneralRe: Gradients Pin
TrungHuynh31-May-04 13:24
TrungHuynh31-May-04 13:24 
GeneralRe: Gradients The Best Pin
Sumit Kapoor31-May-04 18:04
Sumit Kapoor31-May-04 18:04 
GeneralRe: Gradients The Best Pin
Archer28231-May-04 18:09
Archer28231-May-04 18:09 
GeneralRe: Gradients The Best Pin
Sumit Kapoor31-May-04 19:25
Sumit Kapoor31-May-04 19:25 
GeneralRe: Gradients The Best (Mistake due to HTML) Pin
Sumit Kapoor31-May-04 18:19
Sumit Kapoor31-May-04 18:19 
GeneralRe: Gradients Pin
Rick York1-Jun-04 10:37
mveRick York1-Jun-04 10:37 
QuestionHow to add Controls in CView Pin
RedDragon2k31-May-04 4:59
RedDragon2k31-May-04 4:59 
AnswerRe: How to add Controls in CView Pin
valikac31-May-04 6:54
valikac31-May-04 6:54 
AnswerRe: How to add Controls in CView Pin
includeh1031-May-04 6:58
includeh1031-May-04 6:58 
AnswerRe: How to add Controls in CView Pin
David Crow1-Jun-04 4:03
David Crow1-Jun-04 4:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.