Advertisement
isotonicq

Untitled

Apr 18th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. using System;
  2. using System.CodeDom.Compiler;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Runtime.CompilerServices;
  8. using System.Security.Cryptography.X509Certificates;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using System.Windows.Forms;
  12.  
  13. namespace WindowsFormsApp1
  14. {
  15. class BoardMaker
  16. {
  17. public bool Draw(Form board)
  18. {
  19. var errors = false;
  20.  
  21. try
  22. {
  23. var _boardX = 0;
  24. var _boardY = 0;
  25.  
  26. for (int x = 0; x < 10; x++)
  27. {
  28. for (int y = 0; y < 10; y++)
  29. {
  30. var temp = new Button()
  31. {
  32. Height = 20,
  33. Width = 20,
  34. Location = new Point(_boardX, _boardY),
  35. };
  36.  
  37. board.Controls.Add(temp);
  38.  
  39. _boardY += 20;
  40. }
  41. _boardY = 0;
  42. _boardX += 20;
  43. }
  44.  
  45. }
  46. catch (Exception e)
  47. {
  48. errors = true;
  49. }
  50.  
  51. return errors;
  52. });
  53. }
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement