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.).

Share the Post:
Share on facebook
Share on twitter
Share on linkedin


The Latest

microsoft careers

Top Careers at Microsoft

Microsoft has gained its position as one of the top companies in the world, and Microsoft careers are flourishing. This multinational company is efficiently developing popular software and computers with other consumer electronics. It is a dream come true for so many people to acquire a high paid, high-prestige job

your company's audio

4 Areas of Your Company Where Your Audio Really Matters

Your company probably relies on audio more than you realize. Whether you’re creating a spoken text message to a colleague or giving a speech, you want your audio to shine. Otherwise, you could cause avoidable friction points and potentially hurt your brand reputation. For example, let’s say you create a

chrome os developer mode

How to Turn on Chrome OS Developer Mode

Google’s Chrome OS is a popular operating system that is widely used on Chromebooks and other devices. While it is designed to be simple and user-friendly, there are times when users may want to access additional features and functionality. One way to do this is by turning on Chrome OS