Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.Windows.MessageBox vs System.Windows.Forms.MessageBox

Tags:

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?

like image 680
MisterXero Avatar asked Jan 11 '11 17:01

MisterXero


People also ask

What is MessageBox class explain MessageBox () in detail?

A message box is a prefabricated modal dialog box that displays a text message to a user. You show a message box by calling the static Show method of the MessageBox class. The text message that is displayed is the string argument that you pass to Show.


1 Answers

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

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

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.

like image 111
Reed Copsey Avatar answered Oct 12 '22 21:10

Reed Copsey