close

1128  

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

namespace WindowsFormsApplication4
{
public partial class Form1 : Form
{
Button[,] buttons = new Button[4, 4];
Random irand = new Random();
int rd = 0;
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(80 + i * 50, 80 + j * 50);
buttons[i, j].Size = new Size(50, 50);
buttons[i, j].Text = Convert.ToString(i * j);
rd = irand.Next(0, 16);
buttons[i, j].Text = Convert.ToString(rd);
this.Controls.Add(buttons[i, j]);
}
}
}
}
}

 

arrow
arrow
    全站熱搜

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