我正在开发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] 删除。
我来说两句