winform 点击控件拖动窗体

       private Point mPoint = new Point();

         private void 选择控件_MouseDown(object sender, MouseEventArgs e)
{
mPoint.X = e.X;
mPoint.Y = e.Y;
} private void 选择控件_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
Point myPosittion = MousePosition;
myPosittion.Offset(-mPoint.X, -mPoint.Y);
Location = myPosittion;
}
}

  

上一篇:mac 开发必备软件(不断update ing...)


下一篇:dubbo应用架构演进路线图