|
Button a = null;
public Form1 ()
{
InitializeComponent ();
}
private void Form1_Load (object sender, EventArgs e)
{
for (int i = 0; i <2; i ++)
{
a = new Button ();
a.Text = i.ToString ();
this.flowLayoutPanel1.Controls.Add (a);
a.Click + = new System.EventHandler (this.button1_Click);
}
}
private void button1_Click (object sender, EventArgs e)
{
MessageBox.Show (a.Text);
}
There are 2 buttons on the panel, but no matter which one you click, 2
What I want to achieve is point 1 pop up 1 point 2 pop up 2 |
|