Solved

Fox 9 Combo boxes

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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
Viewers will learn the different options available in the Backstage view in Excel 2013.
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 …

739 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