close

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 WindowsFormsApplication1
{

public partial class Form1 : Form
{
//System.Windows.Forms.Button Button1;
int width, height;
int i, j,c;
Button[,] Buttons = new Button[10, 10];
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{

for( i=1; i<10;i++)
{
for (j = 1; j < 10; j++)
{
Buttons[i, j] = new Button();
this.Controls.Add(Buttons[i, j]);
Buttons[i, j].Location = new Point(i * 66, j * 75);
width = this.Size.Width;
height = this.Size.Height;
width /= 11;
height /=11;
Buttons[i,j].Size = new Size(width, height);
c = i * j;
Buttons[i, j].Text = Convert.ToString(c);


}
}
}
}
}

arrow
arrow
    全站熱搜

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