Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FolderBrowserDialog showing SelectedPath issue

Tags:

c#

winforms

So I have a folder browser dialog and am having issues with the selected path.

So I want the previous folder that was opened to be selected, and I want it to be scrolled down so that the previous folder is visible.

Now the strange thing is that this works fine, but only sometimes. It's completely random. The path is always highlighted, but it doesn't always scroll down.

Sometimes when I start debugging and click browse, it will open up and be scrolled down to where I want. Then I click ok, click browse again and it's completely random whether or not it's scrolled down to where it should be.

Any thoughts?

Edit: I searched around a lot and found this. It seems to be quite similar to my problem.

"I have tried the test app on Vista 32, XP 32, Win 7 32 & 64. It works fine on everything except Windows 7. Both 32 and 64 appear to have the same issue."

They're saying it's a glitch with Windows 7...?

like image 872
NMunro Avatar asked Sep 14 '12 17:09

NMunro


2 Answers

I ended up using the Ookii dialogs folder browser dialog. Honestly it's just much better than the default folder browser. It also comes with an example, showing you how to use it.

like image 159
NMunro Avatar answered Nov 11 '22 05:11

NMunro


this works for me

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

but only after the second use of the dialog

like image 2
oferb Avatar answered Nov 11 '22 05:11

oferb