Chinaunix首页 | 论坛 | 博客
  • 博客访问: 78275
  • 博文数量: 4
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 250
  • 用 户 组: 普通用户
  • 注册时间: 2007-03-20 09:43
文章分类

全部博文(4)

文章存档

2009年(1)

2008年(3)

我的朋友
最近访客

分类: C/C++

2008-05-07 11:28:45


 

private Point mouse_offset;
private void label1_MouseDown(object sender, MouseEventArgs e)
{
mouse_offset = new Point(-e.X, -e.Y);
}
private void Common_MouseMove(object sender, MouseEventArgs e)
{

((Control)sender).Cursor = Cursors.Arrow;
if (e.Button == MouseButtons.Left)
{
Point mousePos = Control.MousePosition;
mousePos.Offset(mouse_offset.X, mouse_offset.Y);
((Control)sender).Location = ((Control)sender).Parent.PointToClient(mousePos);
}
}

阅读(501) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~