|
-
Jun 13th, 2011, 10:42 AM
#1
Thread Starter
Member
How to open a directory instead of a specific file.
At the moment I am using this:
Code:
Dim Open As New OpenFileDialog
Open.ShowDialog()
TextBox2.Text = Open.FileName
But that only allows me to open specific files. Can I make it so I can open a folder?
-
Jun 13th, 2011, 10:44 AM
#2
Re: How to open a directory instead of a specific file.
-
Jun 13th, 2011, 10:55 AM
#3
Thread Starter
Member
Re: How to open a directory instead of a specific file.
 Originally Posted by ForumAccount
Thanks!
This is my new code:
Code:
Dim Open As New FolderBrowserDialog
Open.ShowDialog()
TextBox2.Text = Open.RootFolder
On the last line should I be using RootFolder or is there another alternative? Also, whatever file I open Textbox2 always shows a "0" not the folder location. Why is this?
-
Jun 13th, 2011, 10:58 AM
#4
Re: How to open a directory instead of a specific file.
Of all the properties which one looks like it would make the most sense of a user selecting a path?
#2048
-
Jun 13th, 2011, 11:08 AM
#5
Re: How to open a directory instead of a specific file.
[Recomendation] do not use "Open" as the object name
More important than the will to succeed, is the will to prepare for success.
Please rate the posts, your comments are the fuel to keep helping people
-
Jun 13th, 2011, 11:35 AM
#6
Thread Starter
Member
Re: How to open a directory instead of a specific file.
 Originally Posted by ForumAccount
Of all the properties which one looks like it would make the most sense of a user selecting a path?
#2048
No idea, that's why I am asking. And Also why is a number appearing instead of a directory?
Thanks! 
EDIT: No worries, I've done it now. Thanks for the help.
Last edited by Procrastinator; Jun 13th, 2011 at 11:38 AM.
-
Jun 13th, 2011, 11:39 AM
#7
Re: How to open a directory instead of a specific file.
really?
Did you read the documentation linked?
So... when you read "Gets or sets the path selected by the user." ... that didn't trigger anything?\
-tg
-
Jun 13th, 2011, 11:40 AM
#8
Thread Starter
Member
Re: How to open a directory instead of a specific file.
Yeah I've got it sorted now. Thanks everyone
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
|