WPF窗体拖拽

构造函数中写入如下代码

  this.Loaded += (r, s) =>
            {
                this.MouseDown += (x, y) =>
                {
                    if (y.LeftButton == MouseButtonState.Pressed)
                    {
                        this.DragMove();
                    }
                };
            };

 

你可能感兴趣的:(WPF,WPF窗体拖拽)