首页 > 移动平台 > 详细

WinForm 无边框窗体 拖动工作区移动窗体 (转)

时间:2014-04-15 21:30:08      阅读:715      评论:0      收藏:0      [点我收藏+]
  • using System; 
  • using System.Collections.Generic; 
  • using System.ComponentModel; 
  • using System.Data; 
  • using System.Drawing; 
  • using System.Text; 
  • using System.Windows.Forms; 
  • namespace TestShow 
  •     public partial class Form1 : Form 
  •     { 
  •         public Form1() 
  •         { 
  •             InitializeComponent(); 
  •         } 
  •         Point downPoint; 
  •         privatevoid pictureBox1_MouseDown(object sender, MouseEventArgs e) 
  •         { 
  •             downPoint = new Point(e.X, e.Y); 
  •         } 
  •         privatevoid pictureBox1_MouseMove(object sender, MouseEventArgs e) 
  •         { 
  •             if (e.Button == MouseButtons.Left) 
  •             { 
  •                 this.Location = new Point(this.Location.X + e.X - downPoint.X, 
  •                     this.Location.Y + e.Y - downPoint.Y); 
  •             } 
  •         } 
  •     } 
  • }

WinForm 无边框窗体 拖动工作区移动窗体 (转),布布扣,bubuko.com

WinForm 无边框窗体 拖动工作区移动窗体 (转)

原文:http://www.cnblogs.com/lunbawu/p/3665226.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!