N
NvrBst
I drag the OpenFileDialog into the WZYWIG editor and set all its
properties. Setting its' InitalDirectory does make the first time it
opens, open up in the right directory. However, everytime after that
it remembers the directory that the user navigated too and opens
initally at that directory there after.
*Begining of My Open Button Event*
//Environment.CurrentDirectory = Application.StartupPath;
//openFileDialog1.InitialDirectory = Application.StartupPath;
//openFileDialog1.RestoreDirectory = true;
//openFileDialog1.RestoreDirectory = false;
openFileDialog1.ShowDialog();
I've tried many permutations of the above. The openFileDialog1
initally shows "C:\Documents\...\bin\Release\" directory, but then I
open a file in "C:\" and then hit the "Open" button again and it
starts at "C:\".
Could somone explain what exactly RestoreDirectory is suppose to do
since I've tried with it set to true and false and it doesn't seem to
change the behavour that I can see? When it says "Restores CWD before
closing" does it mean when its Disposed?
Solutions. The only way I can seem to have the openFileDialog always
open up in a specific directory is to a) always create a new
openfiledialog everytime I want to use one. or b) call the
"openFileDialog1.Reset()" function and re-set all my filters/
initaldirectory etc.
Am I missing something? I'm using VS2008, .NET Framework 3.5.
NB
properties. Setting its' InitalDirectory does make the first time it
opens, open up in the right directory. However, everytime after that
it remembers the directory that the user navigated too and opens
initally at that directory there after.
*Begining of My Open Button Event*
//Environment.CurrentDirectory = Application.StartupPath;
//openFileDialog1.InitialDirectory = Application.StartupPath;
//openFileDialog1.RestoreDirectory = true;
//openFileDialog1.RestoreDirectory = false;
openFileDialog1.ShowDialog();
I've tried many permutations of the above. The openFileDialog1
initally shows "C:\Documents\...\bin\Release\" directory, but then I
open a file in "C:\" and then hit the "Open" button again and it
starts at "C:\".
Could somone explain what exactly RestoreDirectory is suppose to do
since I've tried with it set to true and false and it doesn't seem to
change the behavour that I can see? When it says "Restores CWD before
closing" does it mean when its Disposed?
Solutions. The only way I can seem to have the openFileDialog always
open up in a specific directory is to a) always create a new
openfiledialog everytime I want to use one. or b) call the
"openFileDialog1.Reset()" function and re-set all my filters/
initaldirectory etc.
Am I missing something? I'm using VS2008, .NET Framework 3.5.
NB