Solved

Fox 9 Combo boxes

Posted on 2011-03-14
5
363 Views
Last Modified: 2012-05-11
I have a combo box on a form which works fine.  In the INIT of the combo box  I have:

WITH This
    .AddItem("PACT")
    .AddItem ("MEDICARE")
    .AddItem ("MEDICAL")
    .AddItem ("BLUECROSS")
    .AddItem ("BLUESHIELD")
    .AddItem ("AETNA")
    .AddItem ("HEALTHNET")
    .AddItem ("UNITEDHEALTHCARE")
    .AddItem ("CIGNA")
    .AddItem ("FIRSTCARE")
    .AddItem ("GREATWEST")
    .AddItem ("PACIFICCARE")
    .AddItem ("PRIVALEDGE")
    .AddItem ("CASH")
ENDWITH

User picks the one they want.  

Question:

Is there a way to color code these choices.  FIrst one Red second blue etc.  I know how to control color for the combo box overall .  I dont know if it is possible to color code choices presented in INIT.

Anyone know????

Thank You

D

0
Comment
Question by:Malibucompany
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 29

Accepted Solution

by:
Olaf Doschke earned 200 total points
ID: 35132728
You don't have colors per item in comboboxes or listboxes. You can color disableditems differently from normal items, but then can't pick them of course.

comboboxes have a Picture Array, You can set a picture per item as the 1st column via Combobox1.Picture[n]=picfilename. So if you create mono colored pics you can at least have a color mark before the item text.

Bye, Olaf.
0
 
LVL 42

Assisted Solution

by:pcelba
pcelba earned 200 total points
ID: 35132894
To create colored Combo is easy when you use Popup as the RowSourceType  (= 9)

You may test it when you place following code into the Combo's Init:

DEFINE POPUP ColoredPopup
DEFINE BAR 1 OF ColoredPopup PROMPT "PACT" COLOR ,r/w,,,,b/w
DEFINE BAR 2 OF ColoredPopup PROMPT "MEDICARE" COLOR ,g/w,,,,b/w
DEFINE BAR 3 OF ColoredPopup PROMPT "MEDICAL" COLOR ,b/w,,,,b/w
DEFINE BAR 4 OF ColoredPopup PROMPT "BLUECROSS" COLOR ,r/w+,,,,b/w

THIS.RowSource = 'ColoredPopup'

Color pairs can be defined with RGB() function.

Combo Destroy method should contain:

RELEASE POPUP ColoredPopup
0
 
LVL 29

Assisted Solution

by:Olaf Doschke
Olaf Doschke earned 200 total points
ID: 35132938
Okay, Pavel. I tend to forget about all those special RowSourceTypes. Too lazy to try, how that looks.

Bye, Olaf.
0
 
LVL 42

Assisted Solution

by:pcelba
pcelba earned 200 total points
ID: 35133293
I can say how that looks... Ugly.

I am probably not good in color selection... but we have to use all the features VFP is oferring us. :-)
0
 
LVL 27

Assisted Solution

by:CaptainCyril
CaptainCyril earned 100 total points
ID: 35135266
I would add 16x16 pictures as I am adding the items in the array.

.Picture(.ListCount) = "someimage.jpg"

You can make them little colored squares which are 8x8 inside a 16x16. They would look nice.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem: You created a new custom form in Outlook for your contacts (added fields, deleted fields, changed the layout of fields, whatever) and made it the default form for contacts. The good news is that all new contacts will utilize the new form. T…
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question