WinForm 无边框窗体 拖动工作区移动窗体 (转)
时间:2014-04-15 21:30:08
收藏:0
阅读:716
- 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
原文:http://www.cnblogs.com/lunbawu/p/3665226.html
评论(0)