这个无边框拖动船体,代码很少,却总是记不住,于是就在网上搜了这段代码,记录一下,省的再忘

using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
 using System.Drawing;
 using System.Text;
 using System.Windows.Forms;
 
 namespace WindowsApplication1
 {
     public partial class Form1 : Form
     {
         public Form1()
         {
             InitializeComponent();
         }
 
         private Point mPoint = new Point();
 
         private void Form1_MouseDown(object sender, MouseEventArgs e)
         {
             mPoint.X = e.X;
             mPoint.Y = e.Y;
         }
 
         private void Form1_MouseMove(object sender, MouseEventArgs e)
         {
             if (e.Button == MouseButtons.Left)
             {
                 Point myPosittion = MousePosition;
                 myPosittion.Offset(-mPoint.X, -mPoint.Y);
                 Location = myPosittion;
             }
         }
     }
 }

转载自:烈日轨迹的文章,原文链接:

http://www.cnblogs.com/ap0606122/archive/2012/10/23/2734964.html#undefined

最新文章

  1. RML-怎样的语句会被归纳为同一类型(Unique Batches)
  2. webpack 代码拆分,按需加载
  3. Ueditor配置及在项目中的使用
  4. Jquery图片上传预览效果
  5. css float对于之后布局的影响
  6. nyoj 92 图像有用区域
  7. Flex之自定义事件
  8. 按行N等分某个文件
  9. Citrix服务器虚拟化之三十 XenApp 6.5发布流式应用程序
  10. opencv 1.0 与 2.0的库对应表
  11. java.lang.UnsatisfiedLinkError: Native method not found 三种可能解决方案
  12. chmod 命令——chmod 755与chmod 4755区别(转)
  13. Apache的.htaccess到Nginx的转换
  14. [Hadoop] 启动HDFS缺少服务
  15. [转]Java调用Javascript、Python算法总结
  16. vue-13-swiper组件的使用
  17. 【Selenium-WebDriver自学】WebDriver交互代码(十一)
  18. Scott用户的表结构
  19. python图像处理:pytesseract和PIL
  20. jquery -- 删除节点

热门文章

  1. Mac OS X 程序员利器 – Homebrew安装与使用
  2. 安卓四大组件之一activity
  3. Swift: Initialization-2
  4. [转] C语言多维数组与多级指针
  5. Android -- 利用Broadcast开启Service(转)
  6. Java基础知识强化之IO流笔记21:FileInputStream读取数据
  7. JNI与多线程
  8. noip 2012 借教室 (线段树 二分)
  9. HTML5 ArrayBuffer:类型化数组 (二)
  10. SQL DMO のDMV