I'm making a windows forms application using C#. I add buttons and other controls programmatically at run time. I'd like to know how to handle those buttons' click events?
Try the following
Button b1 = CreateMyButton(); b1.Click += new EventHandler(this.MyButtonHandler); ... void MyButtonHandler(object sender, EventArgs e) { ... }
1.4m articles
1.4m replys
5 comments
57.0k users