• C#——Winform 无边框随意拖动【转载】


     本篇技术内容转载自:http://www.cnblogs.com/ap0606122/archive/2012/10/23/2734964.html

     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;
                 }
             }
         }
     }

  • 相关阅读:
    静态代码块、非静态代码块、构造函数之间的执行顺序
    Linux跨主机传输文件
    🗒 Linux 系统监控
    Mysql Mode
    Mysql 表锁行锁
    Centos 下修改时区
    Redis 解决内存过大
    Mysql 表达式
    Centos 二进制包安装Mysql5.7
    Vim 快捷键
  • 原文地址:https://www.cnblogs.com/witeem/p/5446773.html
Copyright © 2020-2023  润新知