To remove it, you must first remove it from the Controls collection!
That's difficult with your existing code, because unless it's the only button on your form (and it isn't), you will have difficulty identifying which button to remove!
Try this:
public Form1()
{
InitializeComponent();
}
private List<Button> buttons = new List<Button>();
private void button1_Click(object sender, EventArgs e)
{
Button b = new Button();
b.Text = "button2";
Controls.Add(b);
buttons.Add(b);
b.Click += Hello;
}
private void RemoveButtons()
{
foreach (Button b in buttons)
{
Controls.Remove(b);
b.Click -= Hello;
}
buttons.Clear();
}
private void Hello(object sender, EventArgs e)
{
MessageBox.Show("hello World");
}