Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Images in a grid #2
Message
De
04/05/2000 16:06:08
 
 
À
22/04/2000 05:40:51
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00362329
Message ID:
00366307
Vues:
22
Cetin,

I had the same problem of showing different pictures for different records in the grid, and I found your message.
Thanks a lot. It works great.
By the way you do not have to store files names in the table. You can specify them in SetPicture() method.

Irina



>>How do I develop a grid with a different picture in each cell. The VFP Image control doesn't work because it has no ControlSource property; thus, you cannot bind it to a table.
>>
>>Is there some sort of ActiveX control that allows you to bind an image to a table or better yet, the path to an image file (GIF or JPG) that will display the image in that file?
>>
>>-Joel
>
>
>
Joel,
>Unfortunately I don't know Activex controls other than those that ship with VStudio. But you can do it just with native VFP image control if VFP6 (support for jpg, gif). All you need is a little cheat :) Of course loading many images in a grid control could be time consuming (hint: keep rowcount at minimum for your needs to increase performance). Here it goes :
>-Create a table (or use existing) with full file path&names stored.
>-Put a grid on form
>-Set its recordsource to your table
>-Put a container control with an image control in it in a column
>-Size the column and grid row so it would be big enough to show picture
>-Set image control's Strech property to your liking
>-Set column's sparse to .f.
>-Set column's dynamicbackcolor (or some other dynamic* property) to a custom method ( say thisform.SetPicture() ). This is our "cheat" to make it work :)
>- In that custom method add code :
>
This.myGrid.myColumn.myContainer.myImage.picture = myTable.myPictureFilename
>Endwith
>Return This.Grid1.Backcolor
Cetin
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform