Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I use a randomally selected image in a form

Status
Not open for further replies.

dag302

MIS
Sep 30, 2007
1
US
I have a table with a list of names of BMP pictures in one of the fields. The field is a character field. As I move between records in the table, I want the picture to change on the form according to the filename stored in that character field. For example, if the current picture on the form is PICT1.BMP and I move to a record where the contents of that field is PICT2.BMP, I want the picture in the control on the form to automatically change to PICT2.BMP. I've tried this using the IMAGE control, the OLE control, and the OLEBOUND control, but I guess I am not experienced enough to make this work. They have never upgraded from VFP 5.0 on my job. Could someone please give me some advice on how to accomplish this using this version of Visual Foxpro. Some coding examples would be appreciated also.

Thanks,
Deborah
 
Deborah,

This should be fairly straightforward. You place an Image object on the form. Then, in the code that moves the record pointer, you change the Image's Picture property to the filename of the image that you want to display. As far as I can see, that's all you need to do.

One point: If the image files are not in the default directory or on the VFP search path, you will need to set the Picture property to the full path and filename, not just the filename.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top