Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing the colours of items in a listbox
Message
De
02/08/2005 09:05:34
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01037780
Message ID:
01037789
Vues:
19
>I have a list box which is populated by a cursor. The cursor has 2 fields namely Design Ref & Status. If I run my form I will see the following in the list box:
>
>
>JKT001        Pending Release
>JKT002        Submitted
>TR002         Pending Release
>
>
>What I would like to do is if the status is Pending Release then I want those items in the list box to be Yellow and if the status is Submitted I want is set to red.
>
>Is this possible?
>
>I have created the query with something like the following but this just shows them all as red!!
>
>
>WITH thisform.pageframe1.page5.list1
>	.ItemForeColor=IIF(curlist.fabstatus='Pending Release',RGB(255,0,0),RGB(128,128,128))
>	.rowsourcetype=2
>	.rowsource='curlist'
>ENDWITH
>


Neil:

Why not use a grid control instead of a ListBox? It makes it much easier to control colors like you want.

You can make the grid look like a ListBox if you take out the grid lines. You can control color dynamically with DynamicBackColor/DynamicGridColor (see examples in grid's help)


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform