Page 1 of 1

Changing Foreground and Background Colors of ComboBox

Posted: Fri Mar 24, 2006 7:52 am
by dpaterso
Good Morning,

I have tried evey possible combination of color settings (I think) but I cannot get the colors of my ComboBoxes right.

Everywhere in my system (for Get's) I use:

ReDefine Get ... Color CLR_BLUE

and this works perfectly BUT

ReDefine ComboBox ... Color CLR_BLUE Items ...

does nothing i.e. the text display is still Black.

I just need to change the foreground or text color to the same blue as the text of the gets but every time I try to add different color settings like:

ReDefine ComboBox ... Color CLR_BLUE, CLR_BLACK Items ...

or something like that I just don't seem to be able to change ONLY the foreground text color i.e. I seem to manage to make the while thing unreadable.

Any ideas?

Regards,

Dale.

Re: Changing Foreground and Background Colors of ComboBox

Posted: Fri Mar 24, 2006 7:55 am
by Enrico Maria Giordano
Use SetColor() method.

EMG

Posted: Fri Mar 24, 2006 7:57 am
by Antonio Linares
Dale,

Is it a dropdown or a dropdownlist combobox ?

If it has an editable get then it is dropdown.

Posted: Fri Mar 24, 2006 8:01 am
by dpaterso
Hello,

That was quick!

Enrico: SetColor( ) to what?

Antonio: It does not have an editable get.

Thanks,

Dale.

Posted: Fri Mar 24, 2006 8:08 am
by Enrico Maria Giordano
oCbx:SetColor( CLR_RED, CLR_GREEN )

EMG

Posted: Fri Mar 24, 2006 8:12 am
by Antonio Linares
Dale,

When you use:

REDEFINE COMBOBOX ... COLOR ...

that color is used when the combobox has no focus (for a dropdownlist combobox as you are using). When focused, the used color is the system color for selected items (right click on the desktop, properties, appareance, selected items).

Posted: Fri Mar 24, 2006 9:02 am
by dpaterso
Ok - I think I understand.

But - are Gets handled the same way i.e. when focused they use the system colors or is it just the ComboBox that works this way?

I have no problem with Gets and Says.

Regards,

Dale.

Posted: Fri Mar 24, 2006 9:23 am
by Antonio Linares
Dale,

It is a combobox specific Windows behavior.