WPF消息框显示错误消息

桑托什

我正在开发WPF应用程序,并且想要显示带有诸如信息或问题之类符号的消息框。我写了这段代码:

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

但显示错误/红线

错误:system.windows.messagebox.show(string,string,messageboximage)有一些无效的参数

叶夫根尼

你错过了MessageBoxButton争论。请尝试以下操作:

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

确保您使用的MessageBox不是System.Windows命名空间,而是使用命名空间System.Windows.Forms

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章