Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pick a color, not a value in a combobox?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00453293
Message ID:
00453759
Views:
28
Steve,

This kinda works: set the RowSource to the name of a defined popup menu, set the RowWourceType to Popup and define the popup like this:

* 04-Aug-98 fixed via KB Q185090 added the , before the color pair
define popup mypop from 0,0 && in screen
define bar 1 of MyPop prompt "Red" color ,rgb(255,0,0,255,255,255)
define bar 2 of MyPop prompt "Blue" color ,rgb(0,0,255,255,255,255)
define bar 3 of MyPop prompt "Green" color ,rgb(0,255,0,255,255,255)
define bar 4 of MyPop prompt "Red2" color ,rgb(255,0,0,0,0,0)
define bar 5 of MyPop prompt "Blue2" color ,rgb(0,0,255,0,0,0)
define bar 6 of MyPop prompt "Green2" color ,rgb(0,255,0,0,0,0)
define bar 7 of MyPop prompt "Green3" color G+/W
define bar 8 of MyPop prompt "Green3-1" color scheme 1
define bar 9 of MyPop prompt "Green3-2" color scheme 2
define bar 10 of MyPop prompt "Green3-3" color scheme 3
define bar 11 of MyPop prompt "Green3-4" color scheme 4
define bar 12 of MyPop prompt "Green3-5" color scheme 5
define bar 13 of MyPop prompt "Red4" color ,rgb(255,0,0)
define bar 14 of MyPop prompt "Blue4" color ,rgb(0,0,255)
define bar 15 of MyPop prompt "Green4" color ,rgb(0,255,0)

This works better in a listbox because you can see the selected color. In a cbo once you've selected a value it will display in the control ForeColor. You'll have to tweak this somehow to maintain your color display.
>Is there any way to show different color bands as items in a combobox drop-down list? In other words the 1st item in the drop-down list is blue, the 2nd item is red, the 3rd item is yellow.
>
>So the user picks a color and then that color is displayed in the combobox displayvalue. This is for a color-coded system where different colors mean different amounts instead of having numbers for values in my combobox drop-down list.
>
>I know someone has a custom listbox class out here that I have used that allows one to make different drop-down list rows different colors. I may have to use that class.
>
>Or can anyone think of another way to do this?
>
>TIA
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform