Button Button1;
private void Form1_Load( object sender, EventArgs e) {
//Buttonクラスのインスタンスを作成する
this.Button1 = new System.Windows .Forms .Button ( ) ;
//Buttonコントロールのプロパティを設定する
this.Button1 .Name = "Button1" ;
this.Button1 .Text = "押してね" ;
//サイズと位置を設定する
this.Button1 .Location = new Point( 10 , 10 ) ;
this.Button1 .Size = new System.Drawing .Size ( 80 , 20 ) ;
//フォームに追加する
this.Controls .Add ( this.Button1 ) ;
EventHandler click = null ;
click = ( btnSender, btnE) => {
Button btn1 = ( Button) btnSender;
Button btn2 = new Button( ) ;
btn2.Size = btn1.Size ;
btn2.Location = new Point( btn1.Location .X , btn1.Location .Y + btn1.Height ) ;
btn2.Click += new EventHandler( click) ;
btn2.Parent = this;
} ;
this.Button1 .Click += click;
}
ICAgICAgICBCdXR0b24gQnV0dG9uMTsKICAgICAgICBwcml2YXRlIHZvaWQgRm9ybTFfTG9hZChvYmplY3Qgc2VuZGVyLCBFdmVudEFyZ3MgZSkgewogICAgICAgICAgICAvL0J1dHRvbuOCr+ODqeOCueOBruOCpOODs+OCueOCv+ODs+OCueOCkuS9nOaIkOOBmeOCiwogICAgICAgICAgICB0aGlzLkJ1dHRvbjEgPSBuZXcgU3lzdGVtLldpbmRvd3MuRm9ybXMuQnV0dG9uKCk7CgogICAgICAgICAgICAvL0J1dHRvbuOCs+ODs+ODiOODreODvOODq+OBruODl+ODreODkeODhuOCo+OCkuioreWumuOBmeOCiwogICAgICAgICAgICB0aGlzLkJ1dHRvbjEuTmFtZSA9ICJCdXR0b24xIjsKICAgICAgICAgICAgdGhpcy5CdXR0b24xLlRleHQgPSAi5oq844GX44Gm44GtIjsKICAgICAgICAgICAgLy/jgrXjgqTjgrrjgajkvY3nva7jgpLoqK3lrprjgZnjgosKICAgICAgICAgICAgdGhpcy5CdXR0b24xLkxvY2F0aW9uID0gbmV3IFBvaW50KDEwLCAxMCk7CiAgICAgICAgICAgIHRoaXMuQnV0dG9uMS5TaXplID0gbmV3IFN5c3RlbS5EcmF3aW5nLlNpemUoODAsIDIwKTsKCiAgICAgICAgICAgIC8v44OV44Kp44O844Og44Gr6L+95Yqg44GZ44KLCiAgICAgICAgICAgIHRoaXMuQ29udHJvbHMuQWRkKHRoaXMuQnV0dG9uMSk7CgogICAgICAgICAgICBFdmVudEhhbmRsZXIgY2xpY2sgPSBudWxsOwogICAgICAgICAgICBjbGljayA9IChidG5TZW5kZXIsIGJ0bkUpID0+IHsKICAgICAgICAgICAgICAgIEJ1dHRvbiBidG4xID0gKEJ1dHRvbilidG5TZW5kZXI7CiAgICAgICAgICAgICAgICBCdXR0b24gYnRuMiA9IG5ldyBCdXR0b24oKTsKCiAgICAgICAgICAgICAgICBidG4yLlNpemUgPSBidG4xLlNpemU7CiAgICAgICAgICAgICAgICBidG4yLkxvY2F0aW9uID0gbmV3IFBvaW50KGJ0bjEuTG9jYXRpb24uWCwgYnRuMS5Mb2NhdGlvbi5ZICsgYnRuMS5IZWlnaHQpOwogICAgICAgICAgICAgICAgYnRuMi5DbGljayArPSBuZXcgRXZlbnRIYW5kbGVyKGNsaWNrKTsKICAgICAgICAgICAgICAgIGJ0bjIuUGFyZW50ID0gdGhpczsKICAgICAgICAgICAgfTsKCiAgICAgICAgICAgIHRoaXMuQnV0dG9uMS5DbGljayArPSBjbGljazsKICAgICAgICB9Cg==
compilation info
prog.cs(1,16): error CS0116: A namespace can only contain types and namespace declarations
prog.cs(2,22): error CS0116: A namespace can only contain types and namespace declarations
Compilation failed: 2 error(s), 0 warnings
stdout