using System;
using System.Windows.Forms;
namespace test
{
static class program
{
[STAThread]
public static void Main()
{
Console.Write("HI");
Application.Run(new form());
}
}
class form:Form
{
public form()
{
init();
}
private void init()
{
button1.Text="hi";
this.Controls.Add(this.button1);
this.button1.Click += new System.EventHandler(this.qq);
}
private void qq(object sender, EventArgs e)
{
MessageBox.Show("HI");
}
}
}
using System.Windows.Forms;
namespace test
{
static class program
{
[STAThread]
public static void Main()
{
Console.Write("HI");
Application.Run(new form());
}
}
class form:Form
{
public form()
{
init();
}
private void init()
{
button1.Text="hi";
this.Controls.Add(this.button1);
this.button1.Click += new System.EventHandler(this.qq);
}
private void qq(object sender, EventArgs e)
{
MessageBox.Show("HI");
}
}
}
在命令行编译运行
C:/>csc.exe --.cs )
C:/>--