using System;
using System.Collections.Generic;
- Dec 19 Fri 2014 16:08
暫存
- Nov 28 Fri 2014 14:37
99乘法表
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 WindowsFormsApplication12
{
public partial class Form1 : Form
{
System.Windows.Forms.Button Button1;
System.Windows.Forms.Button[] Buttons;
Button[,] buttons = new Button[9, 9];
int i;
int j;
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)
{
int x;
int width, height;
width = this.Size.Width;
height = this.Size.Height;
buttons[i, j] = new Button();
buttons[i, j].Location = new Point(i * 50, j * 50);
x = (i+1) * (j+1);
width = 50;
height = 50;
buttons[i,j].Size = new Size(width, height);
buttons[i,j].Text = x.ToString();
this.Controls.Add(buttons[i, j]);
}
}
//VX();
//HX();
}