Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 App
- {
- public partial class Form1 : Form
- {
- Button[,] buttons;
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- private void button1_Click(object sender, EventArgs e)
- {
- buttons = new Button[10, 10];
- for (int i = 0; i < 9; i++)
- {
- for (int j = 0; j < 9; j++)
- {
- buttons[i, j] = new Button();
- if (buttons[i, j].InvokeRequired)
- {
- buttons[i, j].Invoke(new MethodInvoker(
- delegate
- {
- buttons[i, j].Parent = panel1;
- }));
- }
- buttons[i, j].Size = new Size(10, 10);
- buttons[i, j].Location = new Point(i * 5, j * 5);
- buttons[i, j].Visible = true;
- buttons[i, j].Enabled = true;
- buttons[i, j].Text = ".......";
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment