I tried this also before i wrote to this group. => the source code is the
same :-(
Let me explain it in a different way:
When opening a FileOpenDialog you get all files that match the current
filter.
If you change the filter (e.g. *.* --> *.exe) all files with the file
extension .exe should be shown.
In one of our 2 apps it works without any problems.
In the other no file is shown at all after changing the filter. Even
changing back shows absolutly no results :-( .
The code was copied from the other application (both in one solution, both
are "recompiled"? (dont know the exact english term vs is using here for a
complete new compilation) both access the same folder, error is reproducable
on 4 different PCs) so there can not be any difference :-(.
Thnx in advance
Michael
"Andry_R" wrote:
Hi
It's very unlikely that same code shows different results.
Your explenation is too abstract to jadge something, but you can try that:
1) Try to copy that part of code from one app to the other... The code in
both application seems same to you, but may be different in one simbol(filter
string).
2) Alsow if you have that code in separate function, you can try to use
compiled assembly from one app in the other.
I'm shure that after some tests you will found the answer.
-----------------
Good luck!
Andry
"Michael Grosse" wrote:
I've conquered a very strange behaviour that I cannot account for logically
and therefore seek help in this Discussion Group. I'm currently developing 2
applications and intend to use the standard open File Dialog with the code
snippet found below.
The code snippet is exactly the same in both applications but the behaviour
is fundamentally different. In one application when you select adifferent
filter from the filter selection group box the content of the file chooser is
refreshed. In the other apllication the after changing the filter results in
an empty set of files in the file chooser. Does anybody knowhow I can achieve
a refreshing of the file chooser content in both applications? Or has anybody
had the same problem?
Thank you for your help.
With best regards
Michael
System.Windows.Forms.OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter="Formular (*.form)|*.form|Locale savings(*.fs)|*.fs|All Files
(*.*)|*.*";
ofd.Title= "Open form";
ofd.Multiselect = false;
ofd.FilterIndex = 2;
ofd.RestoreDirectory=true;
System.Windows.Forms.DialogResult test = ofd.ShowDialog();