Results 1 to 5 of 5

Thread: folder shown in folderbrowser dialog?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2004
    Posts
    362

    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

  2. #2
    Addicted Member
    Join Date
    Nov 2010
    Location
    TamilNadu, India
    Posts
    249

    Re: folder shown in folderbrowser dialog?

    try this ...
    vb Code:
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.         Dim _oldpath$ = Label1.Text.ToString
    3.  
    4.         Using _fldrBrwsr As New FolderBrowserDialog
    5.             If My.Computer.FileSystem.DirectoryExists(_oldpath) = True Then
    6.                 _fldrBrwsr.SelectedPath = _oldpath
    7.             End If
    8.             If _fldrBrwsr.ShowDialog = Windows.Forms.DialogResult.OK Then
    9.                 Label1.Text = _fldrBrwsr.SelectedPath
    10.             End If
    11.         End Using
    12.     End Sub

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2004
    Posts
    362

    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?

  4. #4
    New Member
    Join Date
    Oct 2012
    Location
    Scandinavia
    Posts
    4

    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

  5. #5
    Hyperactive Member
    Join Date
    Jan 2007
    Posts
    351

    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
  •  



Click Here to Expand Forum to Full Width