Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bug: Listbox Picture Array fails on 501st Item.
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Title:
Bug: Listbox Picture Array fails on 501st Item.
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00969497
Message ID:
00969497
Views:
67
Hi

If you create a listbox based on an array that has 501 items or more the Picture Array fails. When you add the 501st Picture it erases the Picture for Item one. When you add the 502nd Picture it erases the picture for item 2 etc.

It does not matter if you only set pictures on a subset of the array it still fails once myRow array has over 500 items. However, it works correctly if you use a RowSourceType=0 and then use AddItem. Unfortunately, the AddItem method is 6-7times slower than using an array for the RowSource.

The following code demonstrates the problem. It works fine for tnItems<=500.
* Test --- Test Listbox Picture array
Lparameters tnItems
Release all except tnItems
Public Array myRow(tnItems),myPicture(tnItems)
Public go
Do PictureTest With tnItems
return
Procedure PictureTest
   Lparameters tnItems
   Local ln
   go=CreateObject("Form")
   go.AddObject("myListBox","listBox")
   With go.mylistBox
         .Visible=.T.
         .Clear
         .Width=200
         .height=200
         .RowSourceType=0
         .RowSource=""
         For ln=1 To tnItems
            myRow(ln)="my listbox text"
            myPicture(ln)="..\bmp\grdUnchecked.bmp"
         EndFor

         .RowSourceType=5
         .RowSource="myRow"
         .ListIndex=1
         For ln=1 To tnItems
            .Picture(ln)=myPicture(ln)
         EndFor
   EndWith
   go.Show()      
   return
Simon White
dCipher Computing
Reply
Map
View

Click here to load this message in the networking platform