2014年12月7日 星期日

11/14 九九乘法表
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 WindowsFormsApplication10
{
public partial class Form1 : Form
{
Button[,] buttons = new Button[10, 10];
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
for (int i = 1; i <= 9; i++)
{
for (int j = 1; j <= 9; j++)
{
buttons[i, j] = new Button();
buttons[i, j].Location = new Point(i * 50, j * 50);
buttons[i, j].Size = new Size(50, 50);
buttons[i, j].BackColor = Color.White;
buttons[i, j].Text = (i*j).ToString();
this.Controls.Add(buttons[i, j]);
}
}
}
}
}

0 個意見:

張貼留言

訂閱 張貼留言 [Atom]

<< 首頁