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