zoukankan      html  css  js  c++  java
  • 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;
                 }
             }
         }
     }

  • 相关阅读:
    Leetcode192. 统计词频
    Leetcode1046. 最后一块石头的重量
    Ubuntu20.04 NS3安装配置
    Ubuntu20.04 中文输入法+截图设置+NetAnim安装
    如何注册谷歌邮箱Gmail
    HDU 2612 Find a way
    友链
    2020沈阳区域赛补题&总结
    XShell中设置便捷的复制粘贴
    Hyper Text 超文本
  • 原文地址:https://www.cnblogs.com/witeem/p/5446773.html
Copyright © 2011-2022 走看看