Click to See Complete Forum and Search --> : *.jpg*;*.gif*;*.art* viewer
VB Starter
Sep 26th, 1999, 10:23 AM
I am trying to make a picture viewer in which you can click on a file from a file list box (.jpg, .gif, and .art) and have the image displayed on the same form. If you can help i would appreciate it, i am new at this so please try not to be too complicated.
Thanks
Aaron Young
Sep 27th, 1999, 01:07 PM
Try this example..
Place a Drive List, Dir List and File List Control on a Form, then Add an Image Control, Finally insert the following code:
Private Sub Dir1_Change()
On Error Resume Next
File1 = Dir1
End Sub
Private Sub Drive1_Change()
On Error Resume Next
Dir1 = Drive1
End Sub
Private Sub File1_Click()
On Error Resume Next
Image1 = LoadPicture(File1.Path & "\" & File1)
End Sub
Private Sub Form_Load()
Image1.Stretch = True
File1.Pattern = "*.bmp;*.jpg;*.gif;*.ico"
End Sub
This will display an Image that is selected from the File List, stretched/shrunk to fit the Imagebox.
------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
adyoung@win.bright.net
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.