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
Then you have to compile your solution with this app. manifest (set it in the project properties -> Application -> Point to the new manifest in "Icons and manifest"). If you start your application now it should look like the WinForms- MessageBox. Thanks for the answer.
There is no such namespace System. Forms , the class you were trying to use ( MessageBox ) is in System. Windows.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With