Results 1 to 2 of 2

Thread: displaying a file

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2006

    displaying a file

    I have a VB6 form containing a listbox,the listbox contains filenames corresponding to files inside "C:\TempProject".When I click into a filename inside the listbox,I want to be able to open the file from "C:\TemProject" and display the file in my form.My form has a lot of controls so the space allocated for the display of the picture is relatively small so I want to be able to zoom the file and have the hand tool like in PDF that way i will be able to look at every portion of the file even though the size of the file is greater than the space allocated for the display of the file.
    thanks a lot

  2. #2
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    The 19th Hole

    Re: displaying a file

    This will load the image selected from the listbox into a picture box.

    VB Code:
    1. Private Sub Form_Load()
    2. List1.AddItem "Alf.jpg"
    3. End Sub
    5. Private Sub List1_DblClick()
    6. Dim FilePath As String
    7. FilePath = App.Path & "\" & List1.Text
    8. Picture1.Picture = LoadPicture("" & FilePath & "")
    9. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width