Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Listbox picture property
Message
De
21/01/2002 15:55:33
 
 
À
21/01/2002 14:23:44
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00607926
Message ID:
00607985
Vues:
30
Hello Jerry.

Using VFP7 and a listbox, how can I control which items in a listbox gets which picture?

For example, I want some of my listbox items to have a .picture=mybmp.bmp, but I also want other items to have either no picture or a different picture.


I have not tested to see if you can have items with pictures and without pictures in the same listbox, so you are on your own with that < s >. However, you can set a listbox up so that different items have different pictures. I did that in Chapter 5 of 1001 Things You Wanted to Know About VFP to create a listbox with check boxes (like the view -> toolbars listbox from the VFP main menu). If you do not have "1001 Things" you can download chapter 5 from www.Hentzenwerke.com, it is one of the sample chapters.

Your code is going to look something like this after you have populated the listbox:
WITH This
  FOR lnItem = 1 TO .ListCount
    .Picture[ lnItem ] = IIF( < SomeCondition >, 'Some.bmp', 'SomeOther.bmp' )
  ENDFOR
ENDWITH	
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform