|
-
April 4th, 2001, 05:29 PM
#1
File Dialog Box
Hello! I would like the user to be able to click a button and have a select file dialog box pop up with a directory already specified and a file extention locked in. I know this is possible and easy, just cant remember the way to call it.
Thanks!
-
April 4th, 2001, 08:50 PM
#2
Re: File Dialog Box
I think what you need is a commondialog control.
you can set the file to be selected using filter property, e.g. if you only want to display text file
filter = text (*.txt)
you can call the method ShowOpen to pop up the dialog box.
hope this help.
cksiow
http://vblib.virtualave.net - share our codes
-
April 4th, 2001, 10:49 PM
#3
Re: File Dialog Box
Place a commondialog control on your form, and name it cdbOpen
Then in code,
on error goto ErrHndlr
with cdbOpen
.CancelError=true
.Dialogtitle="Open a file"
.filter="Text Files (*.txt)|*.txt|All Files|*.*"
.initdir="c:\my documents"
.showopen
end with
'Do your work here
Exit sub
ErrHndlr:
'Cancel Was pressed
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|