close

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
Button[,] buttons = new Button[999, 999];
int[] randomize = new int[500];
Random rnd = new Random();

public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
for (int i = 1; i < 5; i++)
{
for (int j = 1; j < 5; j++)
{
buttons[i, j] = new Button();
buttons[i, j].Location = new Point(i * 100, j * 100);
buttons[i, j].Size = new Size(100, 100);

this.Controls.Add(buttons[i, j]);
}
}
}2  

private void button1_Click(object sender, EventArgs e)
{
int pro=0;
for (int i = 1; i < 5; i++)
{

for (int j = 1; j < 5; j++)
{
pro = i * j;
buttons[i, j].Text = pro.ToString();

}
}
}


}
}

arrow
arrow
    全站熱搜

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