zoukankan      html  css  js  c++  java
  • winform拖动无边框窗体

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

    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

  • 相关阅读:
    vue-cli构建项目 npm run build后应该怎么运行在本地查看效果
    解析JSON数组
    Lambda
    keytool不是内部或外部命令
    XML布局
    HTML5本地存储IndexedDB基础使用
    Vue 2.0基础
    cs231n__3. LostFunction
    cs231n__2. K-nearest Neighbors
    week_Last
  • 原文地址:https://www.cnblogs.com/wl952123/p/3936673.html
Copyright © 2011-2022 走看看