How do you get a class to interact with the form to show a message box. I cannot for the life of me work it out!
Thanks,
Ash
How do you get a class to interact with the form to show a message box. I cannot for the life of me work it out!
Thanks,
Ash
Could you post your present code so that we can point where the problem lies?
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!");
System.Windows.MessageBox.Show("Hello world"); //WPF
System.Windows.Forms.MessageBox.Show("Hello world"); //WinForms
using System.Windows.Forms;
...
MessageBox.Show("Hello World!");