|
-
Sep 26th, 1999, 10:23 AM
#1
Thread Starter
Junior Member
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
-
Sep 27th, 1999, 01:07 PM
#2
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:
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
[email protected]
[email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|