|
-
Oct 24th, 2011, 10:44 AM
#1
Thread Starter
Hyperactive Member
folder shown in folderbrowser dialog?
I'm using a folderbrowser dialog to choose a folder. however, the default folder is deep in the directory. when show the dialog, I set the selectedpath to the folder I want, but, the dialog does not show the selected folder in current view. users have to scroll down to see it.
is there a way to make the selected path shown in the current view when the dialog is launched?
thanks
bear
-
Oct 24th, 2011, 10:53 AM
#2
Addicted Member
Re: folder shown in folderbrowser dialog?
try this ...
vb Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim _oldpath$ = Label1.Text.ToString Using _fldrBrwsr As New FolderBrowserDialog If My.Computer.FileSystem.DirectoryExists(_oldpath) = True Then _fldrBrwsr.SelectedPath = _oldpath End If If _fldrBrwsr.ShowDialog = Windows.Forms.DialogResult.OK Then Label1.Text = _fldrBrwsr.SelectedPath End If End Using End Sub
-
Oct 24th, 2011, 11:00 AM
#3
Thread Starter
Hyperactive Member
Re: folder shown in folderbrowser dialog?
thanks. I did that, the selected folder is set, but the problem is: because there are many folders in c:\, so, when the dialog is shown, the selected folder is not in the current view (although it is selected). so, the user has to scroll down to see it. if the current view can show all folders, then it does not have this problem.
I'm using win7 64bits, maybe it is because of it?
-
Oct 4th, 2012, 08:37 AM
#4
New Member
Re: folder shown in folderbrowser dialog?
I have the same problem - of course all developers have... but no one seems to have understood this question?
I was kind of hoping that the fact that we have come to the year of 2012 would mean that things like this wouldn't bother us at all. :-)
BUT: As FlyingBear meant; the correct folder is selected, however - the folder is not to be seen since the folder tree always shows its top (root) when initiated. But we need it to scroll down to the selected folder so the user won't have to do it manually.
How ANYONE with many folders on their hard drive can settle with this lousy behaviour I can't understand.
I'm sure there is a way of scrolling the tree in the folderBrowserDialog - I just don't know how.
/theLingorian
-
Oct 4th, 2012, 09:26 AM
#5
Hyperactive Member
Re: folder shown in folderbrowser dialog?
I use this, and just checked and yes, it works in XP (i.e. autoscrolls to selectedfolder), but not in windows 7.
Only other reference to this on the web I can find is: http://stackoverflow.com/questions/6...elected-folder
EDIT: Also found this: http://go4answers.webhost4life.com/E...no-157227.aspx
Rico
Using: VB.net & MS SQL
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
|