I was having some BIG problems with this function and I think I found out what was going on and I want to share what I found with you guys. When you use the functions
pDC->SetBkColor()
or pDC->SetTextColor()
, it ONLY changes the text, not the actual control. When I was doing this, I was getting a control with a white background but I could get the correct color of the text and when I typed, the text background would be the correct color. To make the actual CONTROL's (such as an edit box) background change, you use this
hbr = CreateSolidBrush().
This will allow you to change the controls background. You can also use
hbr = CreatePatternBrush()
to display a .bmp in the background. So depending on what control comes up (use nCtlColor or pWnd->GetDlgCtrlID() to determine the control), you can set the colors how you want. If anyone needs help on this I'd be more than happy to help....believe me, I've spend many hours trying to figgure this out!
Niky Williams
NTS Marketing
pDC->SetBkColor()
or pDC->SetTextColor()
, it ONLY changes the text, not the actual control. When I was doing this, I was getting a control with a white background but I could get the correct color of the text and when I typed, the text background would be the correct color. To make the actual CONTROL's (such as an edit box) background change, you use this
hbr = CreateSolidBrush().
This will allow you to change the controls background. You can also use
hbr = CreatePatternBrush()
to display a .bmp in the background. So depending on what control comes up (use nCtlColor or pWnd->GetDlgCtrlID() to determine the control), you can set the colors how you want. If anyone needs help on this I'd be more than happy to help....believe me, I've spend many hours trying to figgure this out!
Niky Williams
NTS Marketing