PDA

Click to See Complete Forum and Search --> : Opening a Existing file


Evan
Nov 15th, 1999, 01:09 AM
Hi,

This is something I dont understand.. AT ALL.
I even have a example I cant figure it out ( the guy wrote it WAY above me)

So could someone give me a SIMPLE example of how to open a BMP file from the computer ( so that the user picks the file)

Help please?

Serge
Nov 15th, 1999, 02:00 AM
Sure. Add Microsoft CommonDialog Control, PictureBox and Command Button to your form. Change the AutoSize property of the PictureBox to TRUE. Put this code on Button's Click event:


Private Sub Command1_Click()
Dim strPath As String

On Error Resume Next

With CommonDialog1
.Filter = "Bitmap Files (*.bmp)|*.bmp"
.ShowOpen
If Err.Number = cdlCancel Then Exit Sub
strPath = .FileName
End With
Picture1.Picture = LoadPicture(strPath)
End Sub




Regards,



------------------

Serge

Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)

Dayo312
Nov 15th, 1999, 02:35 AM
THANK YOU SO MUCH!!!!