Guest User

Untitled

a guest
Jun 20th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. using System;
  2. using System.Windows.Forms;
  3.  
  4. class buttonTest:Form
  5. {
  6. Button b=new Button();
  7.  
  8. public buttonTest()
  9. {
  10. b.Text="Click";
  11. b.ForeColor=System.Drawing.Color.Red;
  12. b.BackColor=System.Drawing.Color.Aqua;
  13. b.Click+=new System.EventHandler(btn_click);
  14. b.Size = new System.Drawing.Size(100,24);
  15. b.Location=new System.Drawing.Point(50,50);
  16. this.Controls.Add(b);
  17. }
  18.  
  19. public void btn_click(Object o,EventArgs e)
  20. {
  21. MessageBox.Show("Click");
  22. }
  23.  
  24. public static void Main()
  25. {
  26. Application.Run(new buttonTest());
  27. }
  28. }
Add Comment
Please, Sign In to add comment