这个问题应该怎么解决?
public void Arrange()
{
int r=15;
int c=16;
for (int i=0;i<r;i++)
{
for (int j=0;j<c;j++)
{
Button btn=new Button();
btn.Click += Button7_Click;
btn.ID=(i+1).ToString()+"-"+(j+1).ToString();
btn.Text = "";
btn.Width = 40;
btn.Height = 30;
btn.ToolTip=(i + 1).ToString() + "-" + (j + 1).ToString();
Panel1.Controls.Add(btn);
}
}
}
public void Button7_Click(object sender, EventArgs e)
{
btn.BorderColor = System.Drawing.Color.Green;
}