Is There a Messagebox Equivalent in Wpf

Is there a MessageBox equivalent in WPF?

The WPF equivalent would be the System.Windows.MessageBox. It has a quite similar interface, but uses other enumerations for parameters and return value.

Windows.Forms.MessageBox in WPF Application

for everybody with the same question, this thread explained and even solved the problem:

http://social.msdn.microsoft.com/Forums/vstudio/en-US/116bcd83-93bf-42f3-9bfe-da9e7de37546/messagebox-closes-immediately-in-dispatcherunhandledexception-handler?forum=wpf

How to create message box in wpf

This is your simplest solution

        MessageBox.Show("This is your messagebox  with AbortRetryIgnore Buttons", "Your title", MessageBoxButtons.AbortRetryIgnore);
        MessageBox.Show("This is your messagebox with OK Button", "Your title", MessageBoxButtons.OK);

MessageBox.Show("This is your messagebox with OK Cancel Buttons", "Your title", MessageBoxButtons.OKCancel);

MessageBox.Show("This is your messagebox with Retry Cancel Buttons", "Your title", MessageBoxButtons.RetryCancel);

MessageBox.Show("This is your messagebox with Yes No Buttons", "Your title", MessageBoxButtons.YesNo);

MessageBox.Show("This is your messagebox with Yes No Cancel Buttons", "Your title", MessageBoxButtons.YesNoCancel);

WPF- MessageBox to be top most

You will have to create your own Window and set its Topmost value to true.

MyWindow dialog = new MyWindow();
dialog.Topmost = true;
dialog.Show();

Custom MessageBox Button In WPF

You can customize WPF Toolkit Extende MessageBox. Or you can use a custom one WPFCustomMessageBox that ACB suggested.

WPF Messagebox shows Error message

You have missed the MessageBoxButton argument. Try the following:

MessageBox.Show("Added successfully", "Alert", MessageBoxButton.OK, MessageBoxImage.Information);

Make sure you are using MessageBox from System.Windows namespace, not System.Windows.Forms.



Related Topics



Leave a reply



Submit