C#中模仿鼠标拖动窗口
来源:互联网 发布:ubuntu 被删除文件 编辑:程序博客网 时间:2024/04/29 10:00
int x = 0,y=0;//记录鼠标按下时的鼠标所在位置
Boolean flag = false;//标记鼠标是否按下
//添加鼠标移动事件
private void Form1_MouseMove(object sender, MouseEventArgs e)
{
if (flag == true)
{
//设置窗口的位置
this.Left += e.Location.X - x;
this.Top += e.Location.Y - y;
}
}
//添加鼠标按下事件
private void Form1_MouseDown(object sender, MouseEventArgs e)
{
//记录当前鼠标位置
x = e.Location.X;
y = e.Location.Y;
flag = true;//鼠标按下
}
//添加鼠标放开事件
private void Form1_MouseUp(object sender, MouseEventArgs e)
{
flag = false;//鼠标放开
}
- C#中模仿鼠标拖动窗口
- C# 鼠标拖动WinForm无边框窗口
- C#中实现窗口拖动
- C#使用_鼠标拖动无标题栏窗口
- C# 鼠标拖动图片
- c#界面鼠标拖动
- c#界面鼠标拖动
- wpf 鼠标拖动窗口方法
- QT 鼠标拖动无标题窗口
- C# 窗口实现拖动
- 鼠标单击窗口标题栏,不能拖动窗口
- c# WPF 中图片缩放功能,鼠标拖动位置
- c# 鼠标拖动控件 张宇轩
- C#鼠标拖动窗体代码
- C#鼠标拖动图片picturebox
- C#鼠标拖动图片picturebox
- c#鼠标拖动画矩形
- c# 实现鼠标拖动form
- chap2:信息的表示和处理
- 给我留个门
- ASP.NET之编码模式——内联编码和隐藏编码
- 找出101到200之间的素数
- 水仙花数问题
- C#中模仿鼠标拖动窗口
- ubuntu 垃圾清理
- 从“煮酒论英雄”谈起
- 兔子生兔子问题
- Cocoa 通过网络获取xml文件并解析
- Comparable 与 Comparator
- CentOS下的C连接Mysql数据库
- Linux(fedora 10)Hello World模块
- DataGrid和ItemsControl实现父与子之间1:N的列表