Combo Box Issue

  • Thread starter Thread starter Andy
  • Start date Start date
A

Andy

I have a combo box on a form. I programatically set the
combo enabled property to false.
The combo box is grayed out.
I then try and change the background color of the combo
box to make it nore readable, but the property does not
seem to work. The combo box is still grayed out.
This works when the combo is enabled.
Any Suggestions ??
 
* "Andy said:
I have a combo box on a form. I programatically set the
combo enabled property to false.
The combo box is grayed out.
I then try and change the background color of the combo
box to make it nore readable, but the property does not
seem to work. The combo box is still grayed out.
This works when the combo is enabled.
Any Suggestions ??

Change the system color settings...

;-)
 
I believe what he means is to go to the system color and change the setting
for a disabled control. This would however change the settings for every
disabled control and wouldn't be very localized. I believe what you'll
discover is that you are successfly changing the color properties but that
it doesn't show until you reenable the combobox. By disabling it you are
changing what properties are used for the control. If you don't find
another way of changing the disabled colors then I would suggest another
tactic of keeping the user from editing that combobox. You can use the
events to make it ignore any user input without disabling it. This would
probably best be done by overriding the control however. You can either
ignore mouse clicks and key strokes or you can make it lose focus whenever
it gains it. The problem there is knowing where to put the focus if one
trys to get to it. If you have any specific question about how to do either
of my ideas let me know and I can give more detail.

Good luck,
Brandon
 
Back
Top