Professional UI Solutions
Site Map   /  Register
 
 

Forum

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 Tech Support » Disabled CExtComboBox Collapse All
Subject Author Date
Ian Hollamby Oct 22, 2007 - 5:49 AM

The text color of a disabled combo is different to that of a disabled edit control, is there a reason for this as on my monitor the colors chosen for the combo lack contrast from the background so it is very hard to see the text.

We are using the Obsidian theme.

Is there a way to change the defaults in the theme without having to change every Combo control we define?

Thanks

Ian Hollamby Nov 29, 2007 - 6:18 AM

The Combo’s are drop down lists, please note that the disabled edit controls also have the same problem.

I took the updated version of CExtComboBox and forced all text colors to black still with no result. So the only solution we could come up with is to override the background color used in the Scheme (m_clrFillHint).

    //m_clrFillHint = RGB(173,174,189);        
    m_clrFillHint = RGB(203,204,219); // To Improve contrast of text when in Windows XP style

This is not a pretty solution as I am sure you will agree so I would still prefer to change the text color if at all possible, without having to put our own OnPaint handler in for the combo and edit control.

Any ideas??

Technical Support Nov 28, 2007 - 10:11 AM

Unfortunately the text in disabled controls is always gray. Though we process to the CTLCOLOR_STATIC message to change the text color, this does not work unless the control is enabled. There are two workarounds.

1. If you have a Drop Down combo box, you can retrieve a handle of the inner edit control and change it style to READONLY.

2. If your combo box is Drop List, you can make it owner-drawn so the text will be drawn with a correct color regardless if the combo box is enabled or not. NOTE Here is the updated version of CExtComboBox in which some issues are fixed.

Ian Hollamby Nov 28, 2007 - 6:36 AM

Just tried setting the text color to override the Combo Box with the following line to prove I can:

pWnd->SetTextColor(RGB(0,255,0);

but it only works for enabled controls the text color is not changed for disabled ones!

We now are running V2.82

Thanks again for your help

Ian Hollamby Nov 28, 2007 - 5:55 AM

This was indeed down to the PC settings, my PC was set to Windows XP style and the other PC was set to Windows Classic Style. This changed the system colors. I would have thought that when the background color was changed to suit the theme for the disabled controls the text color would also be changed to guarantee the text is visible.

I am now left thinking that we have to override the disabled text color for all controls to make sure our customers don’t complain, as we cannot tell them to change their PC’s style (to a non default setting) to get over this.

Is this something that you can look at again?

Technical Support Oct 26, 2007 - 7:53 AM

The problem can be with different settings of the system appearance. Check the themes installed on these PC’s, advanced appearance settings, etc. Anyway you can set a particular text color and a background color yourself.

Ian Hollamby Oct 22, 2007 - 7:07 AM

Sorry wrong information there is no difference between the disabled combo and disabled edit control they are as bad as one another, I was originally looking at a read only edit control.

However there is a difference on disabled text color between two PC’s.

My disabled text is RGB(172,168,153) over background RGB(173,174,189) which is too close, whereas the same program on my colleagues machine is RGB(128,128,128) over the same background.

We are using CExtPaintManagerOffice2007_R2_Obsidian

Thanks