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 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();
        }

 

arrow
arrow
    全站熱搜

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