Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use Pictures with ListBox RowSourceType=5?
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
How to use Pictures with ListBox RowSourceType=5?
Divers
Thread ID:
00968986
Message ID:
00968986
Vues:
71
Hi

I have been testing using the listbox with a RowSourceType=5 (Array). The problem I have is how to get a picture for these same elements. There solutions but they all appear to have a bug or I am not understanding it correctly.

The code below works correctly only for a limited number of items. Once the number of items exceeds 500 the pictures disappear. However, if you use the AddItem() method it is much slower but the pictures remain even if there are several thousand items.

I also found that the slowest part of loading a listbox is the assigning of the Picture elements because there is no simple way to allocate the number of required elements before assigning them values.

It would be much better if the Picture property would accept an array name just like the RowSource property does then you could simply say Picture="myPicture".

If anyone has any suggestions for loading Pictures quickly I would be interested to hear about it.

Thanks
Simon White
Use myTable
Public Array  myArray(RecCount()), myPicture(RecCount())
With myListBox
   .RowSourceType=0
   .RowSource=""
   ln1=0
   Scan 
      ln1=ln1+1
      myArray(ln1)=myTable.Desc
      myPicture(ln1)=This.SetListPicture()
   EndScan
   If ln1=0
      myArray(1)=""
   EndIf
   .RowSourceType=5
   .RowSource="myArray"
   For ln1=ln1 To 1 Step -1
     .Picture(ln1)=.PictureArray(ln1)
   EndFor
EndWith
Simon White
dCipher Computing
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform