How do you get a class to interact with the form to show a message box?
This question is related to
c#
class
messagebox
using System.Windows.Forms;
...
MessageBox.Show("Hello World!");
System.Windows.MessageBox.Show("Hello world"); //WPF
System.Windows.Forms.MessageBox.Show("Hello world"); //WinForms
using System.Windows.Forms;
public class message
{
static void Main()
{
MessageBox.Show("Hello World!");
}
}
Try this:
System.Windows.Forms.MessageBox.Show("Here's a message!");
Source: Stackoverflow.com