Professional UI Solutions
Site Map   /  Register


Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » redraw background color for CExtComboBox Collapse All
Subject Author Date
Borremans Pierre Mar 2, 2010 - 2:52 AM

when the CExtComboBox is disabled we want to change the background color.

We only want to change the color of the edit inside the CExtComboBox

Which function I must override ? 

Technical Support Apr 8, 2010 - 9:54 AM

It’s possible to repaint the combo box, but your painting code will not affect the edit control which is a single child window inside the combo box window. The editor control is subclassed with the CExtComboEditCtrlHook class which is derived from the CExtEditBase class. This means you can use the CExtEditBase::SetBkColor() and CExtEditBase::SetTextColor() methods to change the editor colors. You can also handle the WM_ENABLE message in your CExtComboBox-derived class and change the editor colors depending on the enabled state of the combo box window.

Borremans Pierre Apr 7, 2010 - 2:11 AM

To simplify, we want to have the same background color for all disabled control. How to do this ?

Borremans Pierre Mar 25, 2010 - 8:30 AM

I try it wut without success. As I explain I want to have the same color for the cextcombobox in disabled mode than a Cextedit in disabled mode.

If I change the color of my paintmanager the color change, I think that I mus override a function in the paintmanager but which function and how to do change the background color only when the combobox is disabled ?


thanks for your help

Technical Support Mar 3, 2010 - 10:08 AM

Please override the CExtComboBoxBase::OnSubclassInnerEdit() and CExtComboBoxBase::OnQueryInnerEditCtrl() virtual methods. Your methods should subclass the edit control and return pointer to your CExtComboEditCtrlHook-derived editor. Your editor should override the CExtEditBase::OnQueryBackColor() and CExtEditBase::OnQueryTextColor() virtual methods.