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

Popular posts from this blog

delphi - blogger via idHTTP : error 400 bad request -

c++ - compiler errors when initializing EXPECT_CALL with function which has program_options::variables_map as parameter -

How do I check if an insert was successful with MySQLdb in Python? -