I have this code:
If I create the button in this way, it's moving just the last one that I create.
I want to move with every created buttons, but I don't know how to do it.
Code:
public partial class Form1 : Form
{
private Button cudlik;
int i;
public Form1()
{
InitializeComponent();
}
public void button1_Click(object sender, EventArgs e)
{
i++;
cudlik = new Button();
cudlik.Location = new System.Drawing.Point(150, 150 + 20 * i);
cudlik.Size = new System.Drawing.Size(120, 20);
cudlik.Name += "cudlik" + i;
cudlik.Text += i;
this.Controls.Add(cudlik);
timer1.Enabled = true;
}
private void timer1_Tick(object sender, EventArgs e)
{
cudlik.Left += 1;
}
I want to move with every created buttons, but I don't know how to do it.
Comment