473,326 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

OpenFileDialog does not refresh after selection

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();
Nov 17 '05 #1
4 6134
hi,

Are you sure you are using the smae code in both applications?
If you are you should get the same effect.

Are you running both in the same escenario, from the local computer,
accesing the same folder, etc?

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Michael Grosse" <Michael Gr****@discussions.microsoft.com> wrote in message
news:B8**********************************@microsof t.com...
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();

Nov 17 '05 #2
Hi Ignatio,
yes it's exactly the same code. And they're both accessing the same folder.
Both projects are part of one solution.
The applications run on the same computer and at least 4 pcs have this
problem.

Thnx in advance.

Michael

"Ignacio Machin ( .NET/ C# MVP )" wrote:
hi,

Are you sure you are using the smae code in both applications?
If you are you should get the same effect.

Are you running both in the same escenario, from the local computer,
accesing the same folder, etc?

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Michael Grosse" <Michael Gr****@discussions.microsoft.com> wrote in message
news:B8**********************************@microsof t.com...
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();


Nov 17 '05 #3
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();

Nov 17 '05 #4
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();

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Noel Wood | last post by:
Hello, I have a problem that I'm sure is simple but I have searched the newsgroup and have not found it posted before so I apologize if it has been asked heaps of times before. I have a page that...
0
by: andrija | last post by:
When calling OpenFileDialog, in one project I get exception out of memory (untrappable), while in another it works ok. (I create a new project with just this code and it sometimes does not work,...
3
by: bobrad | last post by:
MAYBE SOMEBODY CAM HELP I AM USING THE FOLLOWING CODE TO GET A LOCATION OF A FILE IN A WINFORM DIALOG OpenFileDialog openFileDialog = new OpenFileDialog(); OpenFileDialog.Filter = " Access...
2
by: don | last post by:
has anyone experienced problems with interactions between OpenFileDialog and FileStream? When I select "open" from an OpenFileDialog the subsequent calls to FileStream do not create a file. If I do...
8
by: e-mid | last post by:
why does not openFileDialog have closed event? i want to do something; as soon as the dialog closes. is there a way to do this?
5
by: Ken Kast | last post by:
I've got an OFD attached to a form. It works OK when it first opens, but if I change the file filter, the dialog does not refresh, i.e., the display is just blank. If I press the Open button, then...
5
by: Umoja | last post by:
Hi Guys, I need for one of my form to refresh after a selection is made from a combo box. On my main table I have a status field which the default value is set to ‘No’. Once the selection is made...
3
by: Martijn Mulder | last post by:
It strikes me that System.Windows.Forms.OpenFileDialog seems te 'remember' which directory it was in last, even when a new OpenFileDialog-object is created for every access to the file system....
2
by: billa856 | last post by:
Hi, My project is in MS Access. In that I have one Form in which I have some Comboboxes. 1st one is Independent, 2nd one is dependent on first one, 3rd one is dependent on 1st and 2nd both....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.