#region //移动无边框窗体
private bool _frmBeginMove = false;
Point _frmLocation = new Point();
protected override void OnMouseMove(MouseEventArgs e)
{
if (_frmBeginMove)
{
Point p = this.PointToScreen(e.Location );
p.Offset(-_frmLocation.X,-_frmLocation.Y );
this.Location =p;
}
base.OnMouseMove(e);
}
protected override void OnMouseDown(MouseEventArgs e)
{
this._frmBeginMove = true;
_frmLocation = e.Location;
base.OnMouseDown(e);
}
protected override void OnMouseUp(MouseEventArgs e)
{
this._frmBeginMove = false;
base.OnMouseUp(e);
}
protected override void OnMouseLeave(EventArgs e)
{
_frmLocation = new Point();
this._frmBeginMove = false;
base.OnMouseLeave(e);
}
#endregion