示例#1
0
        private void Drag_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            if (this.IsDragging)
            {
                Point NewPoint;

                NewPoint = form.PointToScreen(new Point(e.X, e.Y));
                NewPoint.Offset(this.ClickedPoint.X * -1, this.ClickedPoint.Y * -1);

                form.Location = NewPoint;
            }
        }
示例#2
0
文件: BasicForm.cs 项目: mind0n/hive
 protected void OnMouseMove(object sender, MouseEventArgs e)
 {
     if (this.IsDragging)
     {
         Point NewPoint;
         NewPoint = this.PointToScreen(new Point(e.X, e.Y));
         //The new point is relative to the original point
         NewPoint.Offset((this.ClickedPoint.X + BorderWidth) * -1,
                         (this.ClickedPoint.Y + BorderWidth) * -1);
         //Finally, assign the form's location to the
         //determined new point
         this.Location = NewPoint;
     }
     base.OnMouseMove(e);
 }