Advertisement
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 WindowsFormsApplication1
- {
- public partial class Form4 : Form
- {
- public Form4()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- Graphics forDraw;
- forDraw = panel1.CreateGraphics();
- Pen p1 = new Pen(Color.Aqua, 20);
- Brush b1 = Brushes.Black;
- forDraw.DrawRectangle(p1, 100, 100, 500, 500);
- forDraw.FillRectangle(b1, 100, 100, 500, 500);
- forDraw = panel1.CreateGraphics();
- Pen p2 = new Pen(Color.Aqua, 20);
- Brush b2 = Brushes.Black;
- forDraw.DrawRectangle(p2, 98, 98, 490, 490);
- forDraw.FillRectangle(b2, 98, 98, 490, 490);
- forDraw = panel1.CreateGraphics();
- Pen p3 = new Pen(Color.Aqua, 20);
- Brush b3 = Brushes.Black;
- forDraw.DrawRectangle(p3, 96, 96, 480, 480);
- forDraw.FillRectangle(b3, 96, 96, 480, 480);
- forDraw = panel1.CreateGraphics();
- Pen p4 = new Pen(Color.Aqua, 20);
- Brush b4 = Brushes.Black;
- forDraw.DrawRectangle(p4, 94, 94, 470, 470);
- forDraw.FillRectangle(b4, 94, 94, 470, 470);
- forDraw = panel1.CreateGraphics();
- Pen p5 = new Pen(Color.Aqua, 20);
- Brush b5 = Brushes.Black;
- forDraw.DrawRectangle(p5, 92, 92, 460, 460);
- forDraw.FillRectangle(b5, 92, 92, 460, 460);
- forDraw = panel1.CreateGraphics();
- Pen p6 = new Pen(Color.Aqua, 20);
- Brush b6 = Brushes.Black;
- forDraw.DrawRectangle(p6, 90, 90, 450, 450);
- forDraw.FillRectangle(b6, 90, 90, 450, 450);
- forDraw = panel1.CreateGraphics();
- Pen p7 = new Pen(Color.Aqua, 20);
- Brush b7 = Brushes.Black;
- forDraw.DrawRectangle(p7, 88, 88, 440, 440);
- forDraw.FillRectangle(b7, 88, 88, 440, 440);
- forDraw = panel1.CreateGraphics();
- Pen p8 = new Pen(Color.Aqua, 20);
- Brush b8 = Brushes.Black;
- forDraw.DrawRectangle(p8, 86, 86, 430, 430);
- forDraw.FillRectangle(b8, 86, 86, 430, 430);
- forDraw = panel1.CreateGraphics();
- Pen p9 = new Pen(Color.Aqua, 20);
- Brush b9 = Brushes.Black;
- forDraw.DrawRectangle(p9, 84, 84, 420, 420);
- forDraw.FillRectangle(b9, 84, 84, 420, 420);
- forDraw = panel1.CreateGraphics();
- Pen p10 = new Pen(Color.Aqua, 20);
- Brush b10 = Brushes.Black;
- forDraw.DrawRectangle(p10, 82, 82, 410, 410);
- forDraw.FillRectangle(b10, 82, 82, 410, 410);
- forDraw = panel1.CreateGraphics();
- Pen p11 = new Pen(Color.Aqua, 20);
- Brush b11 = Brushes.Black;
- forDraw.DrawRectangle(p11, 80, 80, 400, 400);
- forDraw.FillRectangle(b11, 80, 80, 400, 400);
- forDraw = panel1.CreateGraphics();
- Pen p12 = new Pen(Color.Aqua, 20);
- Brush b12 = Brushes.Black;
- forDraw.DrawRectangle(p12, 78, 78, 390, 390);
- forDraw.FillRectangle(b12, 78, 78, 390, 390);
- forDraw = panel1.CreateGraphics();
- Pen p13 = new Pen(Color.Aqua, 20);
- Brush b13 = Brushes.Black;
- forDraw.DrawRectangle(p13, 76, 76, 380, 380);
- forDraw.FillRectangle(b13, 76, 76, 380, 380);
- forDraw = panel1.CreateGraphics();
- Pen p14 = new Pen(Color.Aqua, 20);
- Brush b14 = Brushes.Black;
- forDraw.DrawRectangle(p14, 74, 74, 370, 370);
- forDraw.FillRectangle(b14, 74, 74, 370, 370);
- forDraw = panel1.CreateGraphics();
- Pen p15 = new Pen(Color.Aqua, 20);
- Brush b15 = Brushes.Black;
- forDraw.DrawRectangle(p15, 72, 72, 360, 360);
- forDraw.FillRectangle(b15, 72, 72, 360, 360);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement