我应该使用哪个,它们有什么区别:
System.Windows.Forms.MessageBox
同样的问题也适用于 System.Windows.Forms.SaveFileDialog
和 Microsoft.Win32.SaveFileDialog
。
我只需要显示一个消息框和保存文件对话框(在 Windows XP 上工作)。
感谢您的帮助,kh。
我应该使用哪个,它们有什么区别:
System.Windows.Forms.MessageBox
同样的问题也适用于 System.Windows.Forms.SaveFileDialog
和 Microsoft.Win32.SaveFileDialog
。
我只需要显示一个消息框和保存文件对话框(在 Windows XP 上工作)。
感谢您的帮助,kh。
System.Windows.Forms 命名空间中的控件适用于 WinForms 应用程序。System.Windows 命名空间中的控件适用于 WPF/Silverlight 应用程序。因此,请选择与您应用程序类型相匹配的控件。
其中一个来自WPF,另一个是经典的Windows消息框。
System.Windows是WPF命名空间,System.WIndows.Forms是Win32经典命名空间。
在我的Windows窗体应用程序中,我会使用System.Windows.Forms.MessageBox。
对于SaveDialog也是同样的情况。
Microsoft.Win32.SaveFileDialog
不在System.Windows
命名空间中,但它是 WPF 应用程序的保存文件对话框。 - Cody Gray