WPF Messagebox shows Error message

13,859

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.

Share:
13,859
Santhosh
Author by

Santhosh

Updated on June 06, 2022

Comments

  • Santhosh
    Santhosh almost 2 years

    I'm developing a WPF application and I want to show message box with symbol like information or question. I have written this code:

    MessageBox.Show("Added Sucessfully","Alert",MessageBoxImage.Information);
    

    but it shows an error/red line:

    Error:system.windows.messagebox.show(string,string,messageboximage) has some invalid arguments