Strange! Save or OpenFileDialog not showing.

  • Thread starter Thread starter Ram
  • Start date Start date
R

Ram

I have a strange problem. In my main application openfiledialog or
savefiledialog is not showing. But the same code works when I create a
sample application and paste the code there.
Here is the code
OpenFileDialog dlg = new OpenFileDialog();
dlg.DefaultExt ="xml";
dlg.Filter="XML Files|*.xml";
dlg.ShowDialog();

why is that it is not opening in my main application but works in sample
test applications?

Ram
 
some guesses:
a) the code is not being called.
b) another modal dialog is already open

Sorry I can't be more helpful.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 
I have a strange problem. In my main application openfiledialog
or savefiledialog is not showing. But the same code works when I
create a sample application and paste the code there.
Here is the code
OpenFileDialog dlg = new OpenFileDialog();
dlg.DefaultExt ="xml";
dlg.Filter="XML Files|*.xml";
dlg.ShowDialog();

why is that it is not opening in my main application but works
in sample test applications?

Ram,

Could you post a short, complete program that demonstrates the
problem?

http://www.yoda.arachsys.com/csharp/complete.html
 
Got it. It works with STAThread.Got the tip from some other newsgroup. Hope
this help some other who is having similar kind of problem.

Ram
 
Back
Top