c# - OpenFileDialog InitialDirectory doesn't work -
c# - OpenFileDialog InitialDirectory doesn't work -
i have code:
openfiledialog dialog = new openfiledialog(); dialog.initialdirectory = getdatapath(...); dialog.autoupgradeenabled = false; dialog.filter = getfilter(...); if (dialog.showdialog(this) == dialogresult.ok) {...} i expect, @ every run, have dialog in same folder - getdatapath(...) folder, remains in lastly selected folder.
is right behavior? know how prepare this? if windows saves lastly used path in registry know how find it?
edit1:
with:
dialog.autoupgradeenabled = true; is working expected...
edit2: same problem here any known problems getting savefiledialog's initialdirectory property working in windows 7?
it may require set restoredirectory
openfiledialog dialog = new openfiledialog(); dialog.initialdirectory = getdatapath(...); dialog.restoredirectory = true; dialog.autoupgradeenabled = false; dialog.filter = getfilter(...); if (dialog.showdialog(this) == dialogresult.ok) {...} check link
c# winforms openfiledialog
Comments
Post a Comment