using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing.Drawing2D;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Shapes
{
   public partial class Form1 : Form
   {
      public Form1()
      {
         InitializeComponent();
      }

      private void button5_Click(object sender, EventArgs e)
      {
         pictureBox1.Image = null;
      }

      private void button1_Click(object sender, EventArgs e)
      {
         using (Graphics g = pictureBox1.CreateGraphics())
         {
            using (Pen p = new Pen(Color.Black))
            {
               g.DrawRectangle(p, 1.0f, 1.0f,
                  pictureBox1.Width - 10, pictureBox1.Height - 10);
            }
         }
      }

      private void button2_Click(object sender, EventArgs e)
      {
         using (Graphics g = pictureBox1.CreateGraphics())
         {
            using (LinearGradientBrush lgb =
               new LinearGradientBrush(new Rectangle(1, 1,
               pictureBox1.Width - 10, pictureBox1.Height - 1),
               Color.Cyan, Color.Blue, 90))
            {
               g.FillRectangle(lgb, 1.0f, 1.0f,
                  pictureBox1.Width - 10, pictureBox1.Height - 10);
            }
         }
      }

      private void button3_Click(object sender, EventArgs e)
      {
         using (Graphics g = pictureBox1.CreateGraphics())
         {
            using (Pen p = new Pen(Color.Black))
            {
               g.DrawEllipse(p, 1.0f, 1.0f,
                  pictureBox1.Width - 10, pictureBox1.Height - 10);
            }
         }
      }

      private void button4_Click(object sender, EventArgs e)
      {
         using (Graphics g = pictureBox1.CreateGraphics())
         {
            using (LinearGradientBrush lgb =
               new LinearGradientBrush(new Rectangle(1, 1,
               pictureBox1.Width - 10, pictureBox1.Height - 1),
               Color.Orange, Color.Red, 90))
            {
               g.FillEllipse(lgb, 1.0f, 1.0f,
                  pictureBox1.Width - 10, pictureBox1.Height - 10);
            }
         }
      }

   }
}
