close

             99格

用for迴圈產生9x9格

using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication3
{
public partial class Form1 : Form
{
System.Windows.Forms.Button button1;
System.Windows.Forms.Button[] buttons;
Button[,] button = new Button[9, 9];
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
for (int i = 0; i < 9; i++)
{
for (int j = 0; j < 9; j++)
{
button[i, j] = new Button();
button[i, j].Location = new Point(i * 50, j * 50);
this.Controls.Add(button[i, j]);

}
}
}
private void Button1_Click(object sender, EventArgs e)
{
MessageBox.Show("YA");
}
  
}
}10806952_10202202258572311_1314977237_n  

excel

10808253_10202202271812642_1531569434_n

arrow
arrow
    全站熱搜

    許暐豐 發表在 痞客邦 留言(0) 人氣()