예제 #1
0
 private void gereMovimento(object sender, MouseEventArgs e)
 {
     if (canMove)
     {
         if (other)
         {
             Point p           = atual.PointToClient(new Point(e.X + (sender as Peça).Location.X, e.Y + (sender as Peça).Location.Y));
             Point newlocation = atual.Location;
             newlocation.X += p.X - _Offset.X;
             newlocation.Y += p.Y - _Offset.Y;
             atual.Location = newlocation;
         }
         else
         {
             Point newlocation = atual.Location;
             newlocation.X += e.X - _Offset.X;
             newlocation.Y += e.Y - _Offset.Y;
             atual.Location = newlocation;
         }
     }
 }