Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Question on combo boxes and background colors...
Message
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00723355
Message ID:
00723528
Views:
20
Hi, Cathi...

I only have one workaround, though admittedly it's pretty strange...

Basically, when I display a maintenance/edit screen, there are some columns which are 'code' columns, where I actually display the descriptions from a parent master table. So I use a combo box. Some users are allowed to edit, and some aren't. Problem is that the disabled combo box has an ugly grey foreground for the displayed description, instead of the foreground color that I'd like to use.

So I figured...since a 'disabled' combobox does nothing more than show a piece of text for the display value...I actually set the visible property to false, and I have a textbox control that sits on top of the combox...I set the enabled property to TRUE, the readonly property to TRUE, and the visible property to false. When someone does something that would make the combo 'editable', I set the combobox visible property back to true, and the 'dummy' textbox visible property to false. From the user's perspective, all they ever see is the actual pulldown box go away/come back. It's kludgy, but it solves the original issue of having that ugly grey color that I couldn't change.

I do the same thing with the datetimepicker control...if I'm in a mode where the user can't access the date entry, I make the datetimepicker invisible and place a simple textbox on top of it, displaying the date field.

Agin, for textboxes, I get around this by using the readonly property. Since I'm not 'disabling' the control, it still honors the fore/back colors that I specify. Other advantage of readonly vs enabled is that I have users who like to copy and paste from text fields, even if they're readonly. This can't be done with enabled. And obviously, this entire issue would be mute [for me, at least] if combobox controls had a readonly property!

If memory serves me, FoxPro might have similar issues. As I recall, there are certain aspects of a combobox that are difficult to control [as far as colors go for disabled mode]. So maybe this is a windows issue. I started to take a look at the paint method, but figured that since I had a workaround that solved the display issue, I didn't need to spend any more time on it.

Hope this helps...
Kevin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform