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
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
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?
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
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