Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dynamic ForeColor in Listbox?
Message
 
 
À
13/04/2000 11:10:54
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00359294
Message ID:
00359415
Vues:
10
Hi Bruce,

Here is something you could do.

The listbox has a RowSourceType (9 - Popup) that can accomplish what you are talking about, but it has limitations.

Create a form and drop a listbox on it
Name the listbox lstColors
In the Init of the form put the following:

DEFINE POPUP PrettyColors
DEFINE BAR 1 OF PrettyColors PROMPT "Red" COLOR ,W+/R
DEFINE BAR 2 OF PrettyColors PROMPT "Blue" COLOR ,W+/B
DEFINE BAR 3 OF PrettyColors PROMPT "Green" COLOR ,W+/G

this.lstColors.RowSourceType = 9
this.lstColors.RowSource = "PrettyColors"

Run the form.

You can also change the font, fontsize, style (Bold, Italic,Underline) of individual items. This technique can be used to put color in menu popups too!

The problem with this technique is that to change the contents of the listbox, you must redefine the popup.

Rick

>I swear that I once saw an example of a VFP listbox that allowed dynamic forecolor, among other things. I know that DynamicForeColor and DynamicBackColor are properties of Columns only, but I am nearly certain I saw this somewhere! ;-)
>
>Can anyone point me to such a beast? My client wants a color-coded list of keywords. I can fall back to a grid if I have to, but thought I'd ask...
>
>;-)
>
>--Bruce
Rick Hodder
MCP Visual Foxpro
C#, VB.NET Developer
Independent Consultant
www.RickHodder.com
MyBlog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform