using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace TR { public partial class Form1 : Form { int Move; int Mouse_X; int Mouse_Y; public Form1() { InitializeComponent(); } private void Form1_MouseMove(object sender, MouseEventArgs e) { if (Move == 1) { this.SetDesktopLocation(MousePosition.X - Mouse_X, MousePosition.Y - Mouse_Y); } } private void Form1_MouseUp(object sender, MouseEventArgs e) { Move = 0; } private void Form1_MouseDown(object sender, MouseEventArgs e) { Move = 1; Mouse_X = e.X; Mouse_Y = e.Y; } } }