I am working on winform app. and I have added some controls dynamicaly eg. Button now i want to add an event to that created button, how can i perform this? als
// create some dynamic button
Button b = new Button();
// assign some event to it
b.Click += (sender, e) =>
{
MessageBox.Show("the button was clicked");
};
// add the button to the form
Controls.Add(b);