如何让类与表单交互以显示一个消息框?
如何让类与表单交互以显示一个消息框?
using System.Windows.Forms;
...
MessageBox.Show("Hello World!");
System.Windows.MessageBox.Show("Hello world"); //WPF
System.Windows.Forms.MessageBox.Show("Hello world"); //WinForms
试试这个:
System.Windows.Forms.MessageBox.Show("Here's a message!");
using System.Windows.Forms;
public class message
{
static void Main()
{
MessageBox.Show("Hello World!");
}
}