Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Visual FoxPro
Expertise: Beginner
Feb 22, 2000



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Running an Image Viewer in a Window

How can I run an image viewer in a window portion of a form in Visual FoxPro alongside a scrolling list box?

Here is how to create a form with a thumbnail preview in VFP without any ActiveX control:

  1. Create a form.
  2. Drop an image object onto the form (name it "imgPict").
  3. Set the Stretch to 2 (Stretch).
  4. Drop a listbox onto the form (name it "lstFiles").
  5. Set the RowSourceType to 7 (files).
  6. Set the RowSource to "*.bmp".
  7. Put the following code into the InteractiveChange of the listbox:
    thisform.imgpict.picture = this.Value
  8. Put some BMP files in the current directory.
Run the form, scroll through the BMP files in the listbox, and watch the thumbnail change. This is limited to the types of pictures that VFP can show on a form (VFP can show only BMP and ICO; VFP 6 has more, including GIF, etc.).
DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date