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

  • 相关阅读:
    day18:正则表达式和re模块
    finance1:专业词汇
    Iterator & Iterable 和 Comparable&Comparator
    pandas中三种索引方式(.loc.iloc.ix)
    XML序列化与反序列化
    控件蓝图里控件绑定问题
    Mouse Properties(鼠标属性)
    cSV
    从父控件移除控件
    是否显示鼠标指针
  • 原文地址:https://www.cnblogs.com/witeem/p/5446773.html
Copyright © 2011-2022 走看看