Microsoft KB Archive/136796

= PRB: Graphics Do Not Display When Using List Box with Pictures =

Article ID: 136796

Article Last Modified on 2/15/2000

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition

-



This article was previously published under Q136796



SYMPTOMS
Using the code example on page 289 of the Visual FoxPro Developer's Guide to display graphics next to list box items causes inconsistent results. Sometimes the graphics show and other times they do not. Occasionally, when you click an item in the list, the graphics show only momentarily; then they vanish. You may also discover some of the graphics are present as you scroll down in the list of file names and still others that are not.



CAUSE
There seems to be a limit to the number of graphics Visual FoxPro can display using this example. If you select a directory that has fewer files, resulting in a smaller number of items in the list box, the graphics tend to display more consistently.



STATUS
Microsoft is researching this behavior and will post new information here in the Microsoft Knowledge Base as it becomes available.



Steps to Reproduce Behavior
 Create a form. Place a list box on the form.  In the click event of the list box, enter the following code (also found on page 289 of the Developer's Guide), ensuring the path to the graphic files is correct: FOR iItem = 5 TO THIS.ListCount cExtension = UPPER(RIGHT(THIS.List(iItem),3)) DO CASE CASE cExtension = "DBF" THIS.Picture(iItem) = "tables.bmp" CASE cExtension = "BMP" THIS.Picture(iItem) = "other.bmp" CASE cExtension = "PRG" THIS.Picture(iItem) = "programs.bmp" CASE cExtension = "SCX" THIS.Picture(iItem) = "forms.bmp" OTHERWISE THIS.Picture(iItem) = IIF("]" $ cExtension, ;              "", "textfile.bmp") ENDCASE ENDFOR  Set the RowSourceType of the list box to 7 - Files. Save and run the form. Use the list box control on your form to find the C:\Vfp\Samples\Graphics\Bmps\FoxPro directory and watch the graphics to the left of the file names. Notice the behavior described above.</li></ol>

Additional query words: VFoxWin

Keywords: KB136796

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.