close

1417157386-2753316172_n  

Private Sub CommandButton1_Click()

For i = 1 To 16
Cells(i, 1) = Fix(Rnd() * 16)

Next


End Sub

1417156760-3528149162_n  

namespace WindowsFormsApplication8
{
public partial class Form1 : Form
{
Button[,] buttons = new Button[4, 4];
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
for (int i = 0; i < 4; i++)
{
for (int j = 0; j < 4; j++)
{
buttons[i, j] = new Button();
buttons[i, j].Location = new Point(i * 50, j * 50);
this.Controls.Add(buttons[i,j]);
buttons[i,j].Size = new Size(50,50);
buttons[i, j].Text = Convert.ToString((i + 1)* (j + 1));

}
}
}
}
}

 

arrow
arrow
    全站熱搜

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