Solved

Fox 9 Combo boxes

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

MS Access 2003 or later To MySQL Migration Project Hello All, this is my second article in the category of MS-OFFICE Automation. In internet I am not able to find any comprehensive resource on the Migration of MS Access back-end to MySQL so I fin…
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 …
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
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…

773 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