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 DllXqManager { public partial class Form2 : Form { private Point CurrPoint = new Point(0, 0); private bool CurrMove = false; public Form2() { InitializeComponent(); } private void tEntityControl1_MouseDown(object sender, MouseEventArgs e) { CurrMove = true; CurrPoint.X = e.X; CurrPoint.Y = e.Y; (sender as Control).BringToFront(); } private void tEntityControl1_MouseMove(object sender, MouseEventArgs e) { if (!CurrMove) return; (sender as Control).Left = (sender as Control).Left + e.X - CurrPoint.X; (sender as Control).Top = (sender as Control).Top + e.Y - CurrPoint.Y; } private void tEntityControl1_MouseUp(object sender, MouseEventArgs e) { CurrMove = false; } } }