Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I display a bmp next to some ListBox rows?
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00117892
Message ID:
00117895
Views:
19
>The foxpro online documentation uses MyListBox.picture as an array, which VFP wont allow. The sample code does not seem to work. Also, help does not list ListBox as a control that supports the picture property, even though it appears on the property sheet.

The Picture property is in fact an array and can be referenced as one.

>This code: MyList.picture = "pic.bmp"
>results in a picture next to every row.

Because the filename is being stored to every element of the array, just as it would have been with a normal array reference without subscript operators.

>References such as Mylist.picture(2) result in an error.

You need to use square brackets instead of parentheses. MyList.Picture(2) looks to VFP like a method call, where MyList.Picture[2] looks like an array element reference.

Note that there are limitations to putting pictures next to items in a list, the biggest one being that if your RowSourceType is anything other than None, VFP uses a buffering mechanism for the pictures that holds about 60 pictures. So if your list will have near or more than 60 items, you'll have to use a RowSourceType of None.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform