首页 > 移动平台 > 详细

winform FormBordStyle=none 及 wpf FormBordStyle=none 的鼠标点击移动问题

时间:2014-03-14 18:48:59      阅读:633      评论:0      收藏:0      [点我收藏+]

winform:

//bool formMove = false;//窗体是否移动
//Point formPoint;//记录窗体的位置

private void Login_MouseDown(object sender, MouseEventArgs e)
{
//formPoint = new Point();

//int xOffset;
//int yOffset;
//if (e.Button == MouseButtons.Left)
//{
// xOffset = -e.X - SystemInformation.FrameBorderSize.Width;
// yOffset = -e.Y - SystemInformation.CaptionHeight - SystemInformation.FrameBorderSize.Height;
// formPoint = new Point(xOffset, yOffset);
// formMove = true;//开始移动
//}
}

private void Login_MouseMove(object sender, MouseEventArgs e)
{
//if (formMove == true)
//{
// Point mousePos = Control.MousePosition;
// mousePos.Offset(formPoint.X, formPoint.Y);
// Location = mousePos;
//}
}

private void Login_MouseUp(object sender, MouseEventArgs e)
{
//if (e.Button == MouseButtons.Left)//按下的是鼠标左键
//{
// formMove = false;//停止移动
//}
}

wpf的移动:

private void Login_MouseDown(object sender, MouseEventArgs e)
{
//if (e.LeftButton == MouseButtonState.Pressed)
//{
// DragMove();
//}

}

winform FormBordStyle=none 及 wpf FormBordStyle=none 的鼠标点击移动问题,布布扣,bubuko.com

winform FormBordStyle=none 及 wpf FormBordStyle=none 的鼠标点击移动问题

原文:http://www.cnblogs.com/liyangLife/p/3598789.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!