04-03-2001, 01:34 AM
I want to insert a path to a picture but don't want to type the path. I want to to that with a pop-up screen like an open box from a program....
How do I get some box which will give back the path to a picture?
04-03-2001, 08:02 AM
Create a brand new project with its defaul Form:
' Hold down Control key and press T key
Select "Microsoft Common Dialog Control 6.0"
which is from Visual Basic Service Park 3
available for download from MSDN site
within Visual Basic Service Park 4 and 5.
Click Apply and OK, then double click the control
Select it, and name it as dlgTran in the property window.
Copy and paste the following code and run:
Private Sub Form_Click()
Dim strFilter As String
Dim strPicFile As String
' There is no spaces between 2 categories
strFilter = "Word and any spaces |*.doc|" & _
"Text may be spaces here, too |*.txt|Picture |*.bmp; *.jpg"
.Filter = strFilter
strPicFile = .FileName
' Feed back to see the file name
MsgBox strPicFile, vbOKOnly, "AnhMy Tran"