无边框移动

region 无边框移动

    private Point mPoint;
    private void Panel_MouseDown(object sender, MouseEventArgs e)
    {
        mPoint = new Point(e.X, e.Y);
    }

    private void Panel_MouseMove(object sender, MouseEventArgs e)
    {
        if (e.Button == MouseButtons.Left)
        {
            this.Location = new Point(this.Location.X + e.X - mPoint.X, this.Location.Y + e.Y - mPoint.Y);
        }
    }

endregion

posted @ 2024-03-19 10:40  $虫虫$  阅读(5)  评论(0)    收藏  举报