Background of a drop down combo box 
Author Message
 Background of a drop down combo box

How can I change the background color of the edit line of a drop down
combo box ?
if I handle the WM_CTLCOLOR for the CTLCOLOR_EDIT it draws the desidered
background but it's covered (it still remain a border of 1-2 pixels with
right color) by the default background color.
Thanks in advance.

--

       Stefano Malavasi



Tue, 21 Sep 2004 23:18:27 GMT  
 Background of a drop down combo box
Hi!

This isn't as elegant as it could be, but try some variation on this theme...

    HBRUSH CNg031902Dlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
    {
        HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);

        if (nCtlColor == CTLCOLOR_EDIT)
        {
            CWnd* pParentWnd = pWnd->GetParent();

            if ((IDC_COMBO_RED == pWnd->GetDlgCtrlID()) ||
                (IDC_COMBO_RED == pParentWnd->GetDlgCtrlID()))
            {
                static CBrush brush(RGB(255,0,0));
                pDC->SetBkColor(RGB(255,0,0));
                hbr = brush;
            }
        }
        return hbr;
    }

Jeff...


Quote:
> How can I change the background color of the edit line of a drop down
> combo box ?
> if I handle the WM_CTLCOLOR for the CTLCOLOR_EDIT it draws the desidered
> background but it's covered (it still remain a border of 1-2 pixels with
> right color) by the default background color.
> Thanks in advance.

> --

>        Stefano Malavasi



Tue, 21 Sep 2004 23:54:27 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. One Line Drop Down Combo Box

2. Setting the hight of a list in a combo box (Drop Down List)

3. Drop-Down Combo Box

4. Combo box wont drop down.

5. drop down combo boxes

6. Setting drop down height of combo box

7. Why wont Combo Box drop down?

8. q: toolbar drop down combo box and document data

9. Can't Get Drop-Down List in Combo Box to Appear

10. combo box drop down does not appear.

11. Drop down combo boxes and string lengths??

12. combo box drop down problem

 

 
Powered by phpBB® Forum Software