Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.CodeDom.Compiler;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Drawing;
- using System.Linq;
- using System.Runtime.CompilerServices;
- using System.Security.Cryptography.X509Certificates;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsApp1
- {
- class BoardMaker
- {
- public bool Draw(Form board)
- {
- var errors = false;
- try
- {
- var _boardX = 0;
- var _boardY = 0;
- for (int x = 0; x < 10; x++)
- {
- for (int y = 0; y < 10; y++)
- {
- var temp = new Button()
- {
- Height = 20,
- Width = 20,
- Location = new Point(_boardX, _boardY),
- };
- board.Controls.Add(temp);
- _boardY += 20;
- }
- _boardY = 0;
- _boardX += 20;
- }
- }
- catch (Exception e)
- {
- errors = true;
- }
- return errors;
- });
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement