This is my code that helps me create a button after I click another button. I need help so that when I click another button, let's say button Remove it will remove the last button I created.
private void BtnShto_Click(object sender, EventArgs e)
{
Button button = new Button();
button.Parent = this.pnlMenu;
button.Location = new Point(12 + rreshta, 16 + kolona);
button.Size = new Size(92, 84);
button.FlatStyle = FlatStyle.Flat;
button.BackColor = Color.White;
button.Text = "Tavolina " + j;
button.Name = "btnTavolina" + j;
j++;
rreshta += 100;
if(rreshta > 500)
{
kolona += 100;
rreshta = 0;
}
}