
change background color of drop down list box
Quote:
> I am trying to change the background color of the display portion (not the
> list box) of a drop down list box using the standard technique of
> overwriting OnEraseBackground() via:
> CBrush backBrush(Color);
> // Save old brush.
> CBrush* pOldBrush = pDC->SelectObject(&backBrush);
> CRect rect;
> pDC->GetClipBox(&rect); // Erase the area needed.
> pDC->PatBlt(rect.left, rect.top, rect.Width(), rect.Height(), PATCOPY);
> pDC->SelectObject(pOldBrush);
> return TRUE;
> But it paints the bacground of the dialog instead.
> Any suggestions?
> --
Generally, to change the colors of controls, you must intercept the
WM_CTLCOLOR message in your app. There is an example of how to do this
at the URL below if you're interested.
Cecil
--
Cecil Galbraith
Free programmer's utilities and MFC tips at
http://www.concentric.net/~cgalbrai