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]);
}
}
}
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();
}
}
}
}
}
留言列表