By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 997 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

Wpf MessageBox.Show does not block

P: n/a
Hi,

I have a Wpf application, and have some code in my App.xaml.cs file
that runs on Application_StartUp. It's possible for errors to occur
here, and I let AppDomain.CurrentDomain.UnhandledException or
System.Windows.Application.Current.DispatcherUnhan dledException event
handlers handle any errors.

In the error handling routine, I can call MessageBox.Show to display
an error message to the user. This kinda works, as the messagebox
appears, but the program immediately exits and the message box
closes.

Any ideas how to get the application to wait until the messagebox is
dismissed by the user before shutting down?

Thanks
Andy
Nov 21 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
DH
Andy wrote:
Hi,

I have a Wpf application, and have some code in my App.xaml.cs file
that runs on Application_StartUp. It's possible for errors to occur
here, and I let AppDomain.CurrentDomain.UnhandledException or
System.Windows.Application.Current.DispatcherUnhan dledException event
handlers handle any errors.

In the error handling routine, I can call MessageBox.Show to display
an error message to the user. This kinda works, as the messagebox
appears, but the program immediately exits and the message box
closes.

Any ideas how to get the application to wait until the messagebox is
dismissed by the user before shutting down?

Thanks
Andy
How are you calling the Message box. Please provide a short but complete
sample code.
Nov 21 '08 #2

P: n/a
I tried creating a simple example, but the messagebox behaves
correctly in it.. so I'm at a loss to explain what is going on here.

On Nov 21, 12:04*pm, DH <I.dont.n...@more.spamwrote:
How are you calling the Message box. Please provide a short but complete
sample code.
Nov 21 '08 #3

P: n/a
DH
Andy wrote:
I tried creating a simple example, but the messagebox behaves
correctly in it.. so I'm at a loss to explain what is going on here.

On Nov 21, 12:04 pm, DH <I.dont.n...@more.spamwrote:
>How are you calling the Message box. Please provide a short but complete
sample code.
Provide how you are Calling the event, How you are handelling the event
as well as calling the messagebox and maybe someone in here can tell you
what is happening.
We cannot begin to guess at what your code looks like and why it is
behaving in this fashion.
Nov 21 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.