FolderBrowserDialog showing SelectedPath issue

So, I have a folder browser dialog, and I have problems with the selected path.

So, I want the previous folder to be open for selection, and I want it to be scrolled down so that the previous folder is visible.

Now it’s strange that this works great, but only sometimes. This is completely random. The path is always highlighted, but it does not always scroll down.

Sometimes, when I start debugging and click the Browse button, it opens and scrolls to where I want. Then I click OK, click the Browse button again, and this is completely random, regardless of whether it scrolls to where it should be.

Any thoughts?

Edit: I searched a lot and found this one . This seems like my problem.

"I tried the test application on Vista 32, XP 32, Win 7 32 and 64. It works fine on all but Windows 7. Both 32 and 64 seem to have the same problem."

They say it is crashing with Windows 7 ...?

+6
source share
4 answers

I ended up using the Ookii dialog of the folder browser dialog box. Honestly, this is much better than the default folder browser. It also contains an example showing you how to use it.

+2
source
FolderBrowserDialog folderBrowser = new FolderBrowserDialog(); folderBrowser.Description = "Select Chase 6 Installation Folder"; folderBrowser.RootFolder = Environment.SpecialFolder.ProgramFiles; folderBrowser.ShowNewFolderButton = false; if (Directory.Exists(Properties.Settings.Default.defaultChasePath)) { string x = Properties.Settings.Default.defaultChasePath; //Use API Flag to set correct path, following tahter a catch all better to check //enum for full list RootSetter.SetRootFolder(folderBrowser, RootSetter.CsIdl.FlagDontVerify); folderBrowser.SelectedPath = x; } if (folderBrowser.ShowDialog(this) == DialogResult.OK) { string huz = folderBrowser.SelectedPath; } 

I got from this link

How to open FolderBrowserDialog in the selected folder?

0
source

it works for me

 folderBrowserDialog1.Reset(); folderBrowserDialog1.RootFolder = Environment.SpecialFolder.MyComputer; folderBrowserDialog1.SelectedPath = WorkingFolder; 

but only after the second use of the dialogue

0
source

Set the selected path to the last path to the folder so that it scrolls down.

 if (folderDialog.ShowDialog() == DialogResult.OK) { Properties.Settings.Default.Path = folderDialog.SelectedPath; Properties.Settings.Default.Save(); } 

Change the code inside the if condition.

-1
source

Source: https://habr.com/ru/post/925436/


All Articles