Results 1 to 2 of 2

Thread: Change the Background Color of a control

  1. #1
    amac
    Guest

    Change the Background Color of a control

    How is it done???

    The control is derived from CComboBox if that helps...

  2. #2
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    Ugh, I hate MFC but I'll answer anyway

    If the combo-box contains an Edit control in it... Override the OnCtlColor function of the control derived from CComboBox. Check when the nCtlColor parameter is equal to CTLCOLOR_EDIT. Then, use pDC->SetBkColor and also return a handle to a brush which has the color that you want to use.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width