Facebook
From EjderMagon, 3 Years ago, written in C#.
Embed
Download Paste or View Raw
Hits: 171
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace TR
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         int Move;
  16.         int Mouse_X;
  17.         int Mouse_Y;
  18.         public Form1()
  19.         {
  20.             InitializeComponent();
  21.         }
  22.  
  23.         private void Form1_MouseMove(object sender, MouseEventArgs e)
  24.         {
  25.             if (Move == 1)
  26.             {
  27.                 this.SetDesktopLocation(MousePosition.X - Mouse_X, MousePosition.Y - Mouse_Y);
  28.             }
  29.         }
  30.  
  31.         private void Form1_MouseUp(object sender, MouseEventArgs e)
  32.         {
  33.             Move = 0;
  34.         }
  35.  
  36.         private void Form1_MouseDown(object sender, MouseEventArgs e)
  37.         {
  38.             Move = 1;
  39.             Mouse_X = e.X;
  40.             Mouse_Y = e.Y;
  41.         }
  42.     }
  43. }
  44.