サンプル  プログラム4

1: usingSystem;

2: usingSystem.Windows.Forms;

3:

4: classHello:Form

5: {

6:   staticvoidbtnOnClick(object sender, EventArgs e)

7:   {

8:     MessageBox.Show("したね!");

9:   }

10:

11:   publicstaticvoidMain()

12:   {

13:     Hellohw=newHello();

14:     hw.Text="アプリケーション名";

15:

16:     Buttonbtn=newButton();

17:     btn.Parent=hw;

18:     btn.Text="Push";

19:     btn.Click+=newEventHandler(btnOnClick);

20:

21:     Application.Run(hw);

22:   }

23: }