Facebook
From krzysiek, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 252
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11.     class Grid
  12.     {
  13.         private bool[,] matrix;
  14.  
  15.         public Grid()
  16.         {
  17.             this.matrix = new bool[200, 200];
  18.         }
  19.  
  20.         public void showGrid(PaintEventArgs e)
  21.         {
  22.             for (int i = 0; i < this.matrix.GetLength(0); i++)
  23.             {
  24.                 for(int j = 0; j < this.matrix.GetLength(1); j++)
  25.                 {
  26.                     e.Graphics.DrawRectangle(new Pen(Brushes.DeepSkyBlue), j*10, i*10, 10, 10);
  27.             }
  28.             }
  29.            
  30.         }
  31.  
  32.     }
  33.  
  34.  
  35.  
  36.  
  37. ///
  38.  
  39. using System;
  40. using System.Collections.Generic;
  41. using System.ComponentModel;
  42. using System.Data;
  43. using System.Drawing;
  44. using System.Linq;
  45. using System.Text;
  46. using System.Threading.Tasks;
  47. using System.Windows.Forms;
  48.  
  49.  
  50. namespace wieloskalowe2
  51. {
  52.     public partial class Form1 : Form
  53.     {
  54.         Pen pen = new Pen(Brushes.DeepSkyBlue);
  55.         Grid g = new Grid();
  56.  
  57.         public Form1()
  58.         {
  59.             InitializeComponent();
  60.         }
  61.  
  62.         private void panel1_Paint(object sender, PaintEventArgs e)
  63.         {
  64.             g.showGrid(e);
  65.         }
  66.  
  67.         private void button2_Click(object sender, EventArgs e)
  68.         {
  69.  
  70.  
  71.         }
  72.     }
  73. }
  74.  
  75.  
  76. ////
  77.  
  78.  
  79.