鼠标拖动窗体功能
2012-06-10 10:39
204 查看
static int cx = 0; static int cy = 0; static bool move = false; private void label1_MouseDown(object sender, MouseEventArgs e) { cx = e.X; cy = e.Y; move = true; } private void label1_MouseMove(object sender, MouseEventArgs e) { if (move) { this.Left += e.X - cx; this.Top += e.Y - cy; } } private void label1_MouseUp(object sender, MouseEventArgs e) { move = false; }
相关文章推荐
- unity3D学习【功能实现】之九:鼠标拖动图片
- 可拖动窗口,附带鼠标控制渐变透明,开启关闭功能
- WPF 窗体中的 Canvas 限定范围拖动 鼠标滚轴改变大小
- C# WinForm实现窗体上控件自由拖动功能示例
- 当winform窗体的Bordestyle设置为None时,鼠标可以拖动窗体的办法
- C# WinForm 鼠标左键拖动窗体
- 给 TStringGrid 添加鼠标拖动功能 - 回复 "dxx" 的问题
- C# 如何鼠标拖动无边框窗体
- 通过鼠标任意拖动.NET Winform窗体中的控件
- 鼠标拖动窗体
- MFC无边框的窗体实现用鼠标拖动窗体边缘实现窗体大小变化
- JavaScript简单实现鼠标拖动选择功能
- 在Window工作区按下鼠标左键拖动窗体
- JavaScript简单实现鼠标拖动选择功能
- MFC 客户区 模拟标题栏 功能 ,实现窗体拖动
- C#中实现鼠标拖动窗体的方法
- 【winform】鼠标拖动时显示虚线框,减少窗体绘制
- C# 用鼠标拖动无边框窗体
- AE+C#实现鹰眼功能——(二)(带鼠标拖动)
- VC中鼠标拖动改变窗体大小