Solved

Fox 9 Combo boxes

Posted on 2011-03-14
5
358 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
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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…
We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
Viewers will learn the different options available in the Backstage view in Excel 2013.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…

856 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