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 Drag_Drop_Form
{
    public partial class Form1 : Form
    {
        Boolean click = false;
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_MouseClick(object sender, MouseEventArgs e)
        {

        }

        private void Form1_MouseDown(object sender, MouseEventArgs e)
        {
            click = true;
        }

        private void Form1_MouseUp(object sender, MouseEventArgs e)
        {
            click = false;
            this.Location = new Point(this.Left + e.X, this.Top + e.Y);
        }

        private void Form1_MouseMove(object sender, MouseEventArgs e)
        {
            if (click == true)
            {
                //this.Top = e.Y;
                //this.Left = e.X;
               // this.Location = new Point(e.X, e.Y);
            }
            textBox1.Text = e.X.ToString() + "-" + e.Y.ToString();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
    }
}
