|
-
August 20th, 1999, 05:52 AM
#1
Selecting Directory in Common Dialog Box
How can I select a directory from the Common Dialog Box. It only allows me to select a file. Am I using the wrong control, or are some of my settings incorrect?
-
August 20th, 1999, 06:29 AM
#2
Re: Selecting Directory in Common Dialog Box
-
August 20th, 1999, 07:56 AM
#3
Re: Selecting Directory in Common Dialog Box
Ooops!
I was supposed to post that onto the site wasn't I ? I'll get onto it tonight and let you all know where it is.
Chris Eastwood
CodeGuru - the website for developers
http://www.codeguru.com/vb
-
August 20th, 1999, 08:17 AM
#4
Re: Selecting Directory in Common Dialog Box
I've added the article/code at :
http://www.codeguru.com/vb/articles/1864.shtml
Chris Eastwood
CodeGuru - the website for developers
http://www.codeguru.com/vb
-
August 30th, 1999, 01:46 PM
#5
Re: Selecting Directory in Common Dialog Box
Hi,
If I were you, I'd do the following:
VB provides 3 special controls named, disklistbox,directorylistbox,filelistbox.You can add those controls to your tool box. They 'll search the drives and directories automatically.Add those 3 controls to your form and You need to connect them by the following code.
Sub Drive1_change( )
Dir1.path = Drive1.drive
End sub
Sub Dir1_change( )
File1.path = Dir1.path
End Sub
Sub File1_DblClick( )
On Error GOTO File Error
if (Right$(Dir1.path,1) = "\") then
Filename$ = Dir1.path + File1.filename
else
Filename$ = Dir1.path + "\" + File1.filename
endif
............
............
File ERROR:
Msgbox "File ERROR",48,"dialog box" ' Msg box for file error
resume
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
|