System.Windows.MessageBox VS System.Windows.Forms.MessageBoxWindows、System、MessageBox、Forms

由网友(西瓜糖)分享简介:我无法找出关键的区别是两个消息框之间有什么。 System.Windows.MessageBox之间的区别是什么和 System.Windows.Forms.MessageBox ? I am having trouble finding out what the key differences are betwe...

我无法找出关键的区别是两个消息框之间有什么。 System.Windows.MessageBox之间的区别是什么 System.Windows.Forms.MessageBox

I am having trouble finding out what the key differences are between the two message boxes. What is the difference between System.Windows.MessageBox and System.Windows.Forms.MessageBox?

推荐答案

System.Windows.MessageBox 加入与WPF和WPF组件中存在(presentationFramework.dll)。

System.Windows.MessageBox was added with WPF, and exists within the WPF assemblies (PresentationFramework.dll).

System.Windows.Forms.MessageBox 添加Windows窗体,并在Windows窗体组件存在。

System.Windows.Forms.MessageBox was added with Windows Forms, and exists within the Windows Forms assemblies.

如果你的程序是一个Windows窗体程序,我会用后者( System.Windows.Forms.MessageBox ),因为它不会在依赖拉WPF。在另一方面,如果你正在为WPF,我会使用 System.Windows.MessageBox

If your program is a Windows Forms program, I would use the latter (System.Windows.Forms.MessageBox), as it won't pull in a dependency on WPF. On the other hand, if you are developing for WPF, I'd use System.Windows.MessageBox.

阅读全文

相关推荐

最新文章