Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.Windows.Forms;
  9.  
  10. namespace WindowsFormsApplication1
  11. {
  12.     public partial class Form4 : Form
  13.     {
  14.         public Form4()
  15.         {
  16.             InitializeComponent();
  17.         }
  18.  
  19.         private void button1_Click(object sender, EventArgs e)
  20.         {
  21.             Graphics forDraw;
  22.             forDraw = panel1.CreateGraphics();
  23.             Pen p1 = new Pen(Color.Aqua, 20);
  24.             Brush b1 = Brushes.Black;
  25.             forDraw.DrawRectangle(p1, 100, 100, 500, 500);
  26.             forDraw.FillRectangle(b1, 100, 100, 500, 500);
  27.             forDraw = panel1.CreateGraphics();
  28.             Pen p2 = new Pen(Color.Aqua, 20);
  29.             Brush b2 = Brushes.Black;
  30.             forDraw.DrawRectangle(p2, 98, 98, 490, 490);
  31.             forDraw.FillRectangle(b2, 98, 98, 490, 490);
  32.             forDraw = panel1.CreateGraphics();
  33.             Pen p3 = new Pen(Color.Aqua, 20);
  34.             Brush b3 = Brushes.Black;
  35.             forDraw.DrawRectangle(p3, 96, 96, 480, 480);
  36.             forDraw.FillRectangle(b3, 96, 96, 480, 480);
  37.             forDraw = panel1.CreateGraphics();
  38.             Pen p4 = new Pen(Color.Aqua, 20);
  39.             Brush b4 = Brushes.Black;
  40.             forDraw.DrawRectangle(p4, 94, 94, 470, 470);
  41.             forDraw.FillRectangle(b4, 94, 94, 470, 470);
  42.             forDraw = panel1.CreateGraphics();
  43.             Pen p5 = new Pen(Color.Aqua, 20);
  44.             Brush b5 = Brushes.Black;
  45.             forDraw.DrawRectangle(p5, 92, 92, 460, 460);
  46.             forDraw.FillRectangle(b5, 92, 92, 460, 460);
  47.             forDraw = panel1.CreateGraphics();
  48.             Pen p6 = new Pen(Color.Aqua, 20);
  49.             Brush b6 = Brushes.Black;
  50.             forDraw.DrawRectangle(p6, 90, 90, 450, 450);
  51.             forDraw.FillRectangle(b6, 90, 90, 450, 450);
  52.             forDraw = panel1.CreateGraphics();
  53.             Pen p7 = new Pen(Color.Aqua, 20);
  54.             Brush b7 = Brushes.Black;
  55.             forDraw.DrawRectangle(p7, 88, 88, 440, 440);
  56.             forDraw.FillRectangle(b7, 88, 88, 440, 440);
  57.             forDraw = panel1.CreateGraphics();
  58.             Pen p8 = new Pen(Color.Aqua, 20);
  59.             Brush b8 = Brushes.Black;
  60.             forDraw.DrawRectangle(p8, 86, 86, 430, 430);
  61.             forDraw.FillRectangle(b8, 86, 86, 430, 430);
  62.             forDraw = panel1.CreateGraphics();
  63.             Pen p9 = new Pen(Color.Aqua, 20);
  64.             Brush b9 = Brushes.Black;
  65.             forDraw.DrawRectangle(p9, 84, 84, 420, 420);
  66.             forDraw.FillRectangle(b9, 84, 84, 420, 420);
  67.             forDraw = panel1.CreateGraphics();
  68.             Pen p10 = new Pen(Color.Aqua, 20);
  69.             Brush b10 = Brushes.Black;
  70.             forDraw.DrawRectangle(p10, 82, 82, 410, 410);
  71.             forDraw.FillRectangle(b10, 82, 82, 410, 410);
  72.             forDraw = panel1.CreateGraphics();
  73.             Pen p11 = new Pen(Color.Aqua, 20);
  74.             Brush b11 = Brushes.Black;
  75.             forDraw.DrawRectangle(p11, 80, 80, 400, 400);
  76.             forDraw.FillRectangle(b11, 80, 80, 400, 400);
  77.             forDraw = panel1.CreateGraphics();
  78.             Pen p12 = new Pen(Color.Aqua, 20);
  79.             Brush b12 = Brushes.Black;
  80.             forDraw.DrawRectangle(p12, 78, 78, 390, 390);
  81.             forDraw.FillRectangle(b12, 78, 78, 390, 390);
  82.             forDraw = panel1.CreateGraphics();
  83.             Pen p13 = new Pen(Color.Aqua, 20);
  84.             Brush b13 = Brushes.Black;
  85.             forDraw.DrawRectangle(p13, 76, 76, 380, 380);
  86.             forDraw.FillRectangle(b13, 76, 76, 380, 380);
  87.             forDraw = panel1.CreateGraphics();
  88.             Pen p14 = new Pen(Color.Aqua, 20);
  89.             Brush b14 = Brushes.Black;
  90.             forDraw.DrawRectangle(p14, 74, 74, 370, 370);
  91.             forDraw.FillRectangle(b14, 74, 74, 370, 370);
  92.             forDraw = panel1.CreateGraphics();
  93.             Pen p15 = new Pen(Color.Aqua, 20);
  94.             Brush b15 = Brushes.Black;
  95.             forDraw.DrawRectangle(p15, 72, 72, 360, 360);
  96.             forDraw.FillRectangle(b15, 72, 72, 360, 360);
  97.         }          
  98.        
  99.     }
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement