-
-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VistaOpenFileDialog.InitialDirectory gets ignored #8
Comments
Thanks for reporting @soulflyman. However, I believe this is the "correct" behavior as it matches what happens in all the other apps that come with Windows - i.e. They remember the last folder used. You should be able to reproduce the same with Notepad or Paint. @buildcomplete reported a similar issue with PR #2 so perhaps we need a way to override this behavior somehow (?), ideally as an opt-in setting that doesn't introduce a breaking change. |
That sounds great, I would be totaly fine with a new settign as you mentioned. I was aware of the default behaviour (like notepad) but I exprected this behaviour to change when InitialDirectory is set manualy. |
I am experiencing the same issue. I confirmed that '_initialDirectory' gets set to my desired path in VistaFileDialog.cs.
This I added SetLastError = true to the method signature and tried |
While it is true that many windows applications have a "smart" default behavior to remember your last path, there are many situations where the developer of an app wants to specify a particular initial directory to help the user. For our application landscape this is even the default behavior, as our users expect to load from/save to specific project-related directories. Using the "smart" last directory from notepad/paint/word is annoying and useless here. Plus: The |
I've the same need. |
I went into Ookii library code. then I found how to take into account the
to
That's done. Hope it could help. |
@gitjsdr26 you could create a PR for @augustoproiete |
@nzain , sorry I don't know how to do this with GitHub. |
Ok, I've gathered some more information to shed light onto this issue. We talk about an
Users of Ookii Dialogs will expect the same behavior because the property has the same name. I agree, in many situations this property should not be set (notepad etc.), but that is a different story. If the property is set, it should work as expected. The
I'm not sure if this (no recently used folder available) is ever the case. Setting the default folder never had any effect for me. If that functionality is required for anyone, it should be available as a PR?The #2 PR is open for two years now (!) and suggests a similar thing. Although the author @buildcomplete mentions that it is working at least once in his scenario. His fix seems to be based on old code, but does the same thing as @gitjsdr26 suggests: change the call I don't want to waste time with PR creation (I would change this single line, too). @augustoproiete please let us know what you think about this :) |
I'm giving up on this repo. Fork it, if you want to see something happening. We won't be using it anymore. |
For anyone falling in. |
Initializing a dialog with the property InitialDirectory set to a local and existing folder is ignored.
The Dialog always shows the last folder where a file was opened.
Expected behaviour:
The VistaOpenFileDialog always schow the content of C:\ when InitialDirectory is set to "C:\".
Windows 10 Pro 1903 / .Net Framework 4.6
The text was updated successfully, but these errors were encountered: