views:

1012

answers:

5

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

+1  A: 

Could you post your present code so that we can point where the problem lies?

Igor Brejc
A: 
using System.Windows.Forms;

public class message
{
    static void Main()
    {  
        MessageBox.Show("Hello World!"); 
    }
}
Koistya Navin
+2  A: 

Try this:

System.Windows.Forms.MessageBox.Show("Here's a message!");
Keith Gaughan
+2  A: 
System.Windows.MessageBox.Show("Hello world"); //WPF
System.Windows.Forms.MessageBox.Show("Hello world"); //WinForms
Mehrdad Afshari
+1  A: 
using System.Windows.Forms;
...
MessageBox.Show("Hello World!");
John Gietzen
Awesome thats perfect thanks everyone!! :D
Ash