Пример #1
0
 private void pictureBox_Logo_MouseDown(object sender, MouseEventArgs e)
 {
     //为当前应用程序释放鼠标捕获
     WIN32API.ReleaseCapture();
     //发送消息 让系统误以为在标题栏上按下鼠标
     WIN32API.SendMessage((IntPtr)this.Handle, WIN32API.VM_NCLBUTTONDOWN, WIN32API.HTCAPTION, 0);
 }
Пример #2
0
 private void panel3_MouseDown(object sender, MouseEventArgs e)
 {
     //判断是否标题栏区域
     if (e.Y < 45 && e.X < 335)
     {
         //为当前应用程序释放鼠标捕获
         WIN32API.ReleaseCapture();
         //发送消息 让系统误以为在标题栏上按下鼠标
         WIN32API.SendMessage((IntPtr)this.Handle, WIN32API.VM_NCLBUTTONDOWN, WIN32API.HTCAPTION, 0);
     }
 }