0

I'm setting the SelectedPath parameter of a dialog on a Windows form and it's working. The problem is that it's not visible when the modal form displays. If I scroll down, I can see that it has highlighted the correct folder, but I'd like that folder to be at the top of the scroll window if possible. I'm not too familiar with VB or VStudio so I would appreciate any help. Here's the code that I'm using to set the parameter.

            If myVariables.myEHDConnected = True Then
                dlgTarget.SelectedPath = myVariables.myEHDDrive & "Storage\"
            End If

This code does highlight the directory but it's not visible when the modal form opens.

Ross from Brooklin
  • 293
  • 1
  • 5
  • 18
  • That's not possible. Consider targeting .NET6+ or [this alternative](https://stackoverflow.com/questions/10990612/folder-browser-dialog-like-open-file-dialog) – Hans Passant Nov 25 '22 at 21:04

1 Answers1

0

I changed the Root Folder property of the dialogue to My Computer instead of Desktop and it worked fine. It scrolled down to a point where the selected directory was visible. The problem was mine for not having set the Root Folder properly.

Ross from Brooklin
  • 293
  • 1
  • 5
  • 18