winform拖动窗体
来源:互联网 发布:java爬虫爬取视频 编辑:程序博客网 时间:2024/06/07 09:54
建立一个windows窗体,名字为login,把下面方法加进代码
#region 拖动方法
int LeftTolerance = 0;int TopTolerance = 0;
Point formLocation = new Point(0, 0);
private void Login_MouseDown(object sender, MouseEventArgs e)
{
LeftTolerance = Cursor.Position.X - this.Location.X;
TopTolerance = Cursor.Position.Y - this.Location.Y;
this.Cursor = Cursors.SizeAll;
}
private void Login_MouseMove(object sender, MouseEventArgs e)
{
//拖动中
if (e.Button == MouseButtons.Left)
{
formLocation.X = Cursor.Position.X - LeftTolerance;
formLocation.Y = Cursor.Position.Y - TopTolerance;
this.Location = formLocation;
}
}
private void Login_MouseUp(object sender, MouseEventArgs e)
{
this.Cursor = Cursors.Default;
}
#endregion
- WinForm 禁止拖动窗体
- winform拖动窗体
- 让鼠标拖动WinForm窗体
- Winform无标题栏拖动窗体
- C# WinForm自定义拖动窗体
- WPF和Winform拖动窗体
- WinForm点击窗体任意位置拖动窗体
- .Net winform拖动工作区移动窗体
- C# Winform 自定义鼠标拖动窗体类
- winForm实现拖动无边框窗体
- WinForm 自定义窗体的拖动方法
- C# WinForm 拖动无边框窗体
- C# WinForm 拖动无边框窗体
- Winform 使用panel 自定义拖动窗体
- WinForm鼠标点击窗体拖动事件
- WinForm 无边框窗体 拖动工作区移动窗体
- WinForm 无边框窗体 拖动工作区移动窗体
- 通过鼠标任意拖动.NET Winform窗体中的控件
- 第一个Ant脚本
- 使用FilenameFilter
- centos 安装 oracle 11g R2 开机启动配置
- in-app-billing for google play (google应用内付费 v3)
- Android Studio加载第三方jar包 + 中文乱码
- winform拖动窗体
- 查找附近点--Geohash方案讨论
- linux操作系统实验四--打造自己的Linux发行版(续)
- V$ACTIVE_SESSION_HISTORY视图的列说明
- 比较图像处理中图像的匹配,图像 配准, 图像融合的概念上的不同
- 非常不错的学习博客
- _blank失效问题解决
- 拿二进制存储文件
- 支持xhr浏览器:超时设定加载事件进度事件