Solved

Fox 9 Combo boxes

Posted on 2011-03-14
5
353 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 41

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 41

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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
FoxPro in WIndows 10 23 3,526
When migrating a PC using Easy Transfer 4 55
Excel Automation of Autosum 23 85
encryption on machine 7 68
As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

746 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now