close

 

int x;
int width, height;
int[] myarray = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
// Instantiating all the buttons in the array
for (int j = 1; j < 5; j++)
{
for (int i = 1; i < 5; i++)
{
width = this.Size.Width;
height = this.Size.Height;
buttons[i, j] = new Button();
buttons[i, j].Location = new Point(i * 50, j * 50);
//x = (i + 1) * (j + 1);
x = myarray[(j-1)*4+i-1];

 

width = 50;
height = 50;
buttons[i, j].Size = new Size(width, height);
buttons[i, j].Text = x.ToString();
this.Controls.Add(buttons[i, j]);
}
}

 

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 open7412 的頭像
    open7412

    陳昱穎

    open7412 發表在 痞客邦 留言(0) 人氣()