Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Windows.Forms;
- class buttonTest:Form
- {
- Button b=new Button();
- public buttonTest()
- {
- b.Text="Click";
- b.ForeColor=System.Drawing.Color.Red;
- b.BackColor=System.Drawing.Color.Aqua;
- b.Click+=new System.EventHandler(btn_click);
- b.Size = new System.Drawing.Size(100,24);
- b.Location=new System.Drawing.Point(50,50);
- this.Controls.Add(b);
- }
- public void btn_click(Object o,EventArgs e)
- {
- MessageBox.Show("Click");
- }
- public static void Main()
- {
- Application.Run(new buttonTest());
- }
- }
Add Comment
Please, Sign In to add comment