473,396 Members | 1,671 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,396 software developers and data experts.

Wpf MessageBox.Show does not block

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
3 8056
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Drew Lettington | last post by:
I'm making a simple call to display error messages in a MessageBox from a Windows form and the MessageBox is not behaving in a modal fashion. My modal form displays, the user clicks a button and...
11
by: Rich Tasker | last post by:
I have a strange situation. A simple call to MessageBox.Show("XXX", "YYY") does not display the message in the messagebox with a visible font. Based on the content of the messagebox, the box...
8
by: Saso Zagoranski | last post by:
Hi! I'm trying to make my own MessageBox... What I would like to know is, how the MessageBox class is implemented? I could have something like: new MyMessageBox().ShowDialog(); but I would...
3
by: Sin | last post by:
I'm currently evaluating VC.NET as the new platform for the company I work for and things are looking grim... We're up against another IDE which took me about 5 minutes to master and I've been...
0
by: alex_f_il | last post by:
The class centers MessageBox inside the parent rectangle. Enjoy! using System; using System.Windows.Forms; using System.Text; using System.Drawing; using System.Runtime.InteropServices; ...
20
by: Peter E. Granger | last post by:
I'm having a strange problem (or at least it seems strange to me) trying to display a MessageBox in a VC++ .NET forms application. If I put the call to MessageBox::Show in the form's .h file, it...
5
by: Curt Emich | last post by:
I always thought writing a simple diagnostic message in a message box would be pretty simple. Not in .NET. First, I wrote this amazingly complex piece of code: MessageBox.Show("yer mama") ...
3
by: Kiyomi | last post by:
Hello, I use in my application MessageBox.Show and it works perfectly when I run this application on my local computer (http://localhost). When I diployed this application on the server,...
2
by: Nuno Magalhaes | last post by:
Why does the MessageBox.Show function in the thread below changes the program behaviour, in other words, the APListView becomes filled with values with a call to RefreshAPListView. Without the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.