﻿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 test_graphics
{
    public partial class Form1 : Form
    {
        private Graphics g;

        public Form1()
        {
            InitializeComponent();
            g = this.CreateGraphics();
            this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseClick);
        }

        private void Form1_MouseClick(object sender, MouseEventArgs e)
        {
            Pen pen = new Pen(Color.SlateBlue);
            SolidBrush solid = new SolidBrush(Color.Red);
            g.FillEllipse(solid, e.X, e.Y, 5, 5);
            g.DrawEllipse(pen, e.X, e.Y, 5, 5);

            solid.Dispose();
            pen.Dispose();
 
        }
    }
}
