Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Images in a grid #2
Message
De
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:
00362474
Vues:
18
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform