#region 移动窗体 移动窗口
private Point _mousePoint;
private int topA(Control cc)
{
if (cc == null || cc == this) return 0;
if (cc.Parent == null || cc.Parent == this)
return cc.Top;
else
return topA(cc.Parent) + cc.Top;
}
private int leftA(Control cc)
{
if (cc == null || cc == this) return 0;
if (cc.Parent == null || cc.Parent == this)
return cc.Left;
else
return leftA(cc.Parent) + cc.Left;
}
private void labTitle_MouseDown(object sender, MouseEventArgs e)
{
Control cc = (Control)sender;
if (e.Button == MouseButtons.Left)
{
_mousePoint.X = e.X + leftA(cc);
_mousePoint.Y = e.Y + topA(cc);
}
}
private void labTitle_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
Top = MousePosition.Y - _mousePoint.Y;
Left = MousePosition.X - _mousePoint.X;
}
}
#endregion

  

最新文章

  1. LeetCode 206 Reverse a singly linked list.
  2. SOAPUI使用教程-入门REST测试
  3. js遍历json
  4. ViewController的生命周期
  5. 取消TableViewCell选中状态的外观变化
  6. 移动端lCalendar纯原生js日期时间选择器
  7. swift学习笔记-UI篇之UIImageView
  8. sudo: ./sd_fusing.sh:找不到命令
  9. 统计 iOS 设备锁定、解锁次数-b
  10. Android中sharedPreference的简单使用
  11. The Nerd Factor SPOJ - MYQ5
  12. MySQL增量订阅&消费组件Canal POC
  13. MyBatis Generator 生成器把其他数据库的同名表生成下来的问题
  14. #include 相关问题
  15. It is not safe to rely on the system's timezone settings错误
  16. 【原】Spring AOP实现对Redis的缓存同步
  17. ftp/sftp定时自动上传文件脚本(CentOS)
  18. 安全测试6_Web安全工具第一节(浏览器入门及扩展)
  19. vue + element ui 实现实现动态渲染表格
  20. 判断RadioButtonList是否选中

热门文章

  1. day3-Python集合、函数、文件操作,python包的概念
  2. poj 2955 括号匹配 区间dp
  3. ZOJ 1188 DNA Sorting
  4. html部分---a标签的用法、放置图片与表格;
  5. Windows Phone使用总结(长期更新)
  6. console下纯字符实现的俄罗斯方块
  7. C# TcpClient TcpListener 简单练习01
  8. C++中的单例模式
  9. Python 基础语法(二)
  10. C++面向对象要点